diff options
author | Christoph Müllner <christoph.muellner@vrull.eu> | 2024-06-06 20:30:25 +0200 |
---|---|---|
committer | Christoph Müllner <christophm30@gmail.com> | 2024-06-26 12:18:30 +0200 |
commit | 763c862b846296aa78e879f95ced9930bddac479 (patch) | |
tree | d960dce8ca37b6b3ec5661689394be494cf376ef | |
parent | 3fb1523f2df35da6b1008f13a214e4b4370f7b5a (diff) | |
download | riscv-gnu-toolchain-763c862b846296aa78e879f95ced9930bddac479.zip riscv-gnu-toolchain-763c862b846296aa78e879f95ced9930bddac479.tar.gz riscv-gnu-toolchain-763c862b846296aa78e879f95ced9930bddac479.tar.bz2 |
Add NEWLIB_TARGET_FLAGS_EXTRA
This adds NEWLIB_TARGET_FLAGS_EXTRA, which works the same like GLIBC_TARGET_FLAGS_EXTRA.
The flags are used for configuring newlib or newlib-nano.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
-rw-r--r-- | Makefile.in | 7 | ||||
-rw-r--r-- | README.md | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in index 69e2927..3544fcb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -99,6 +99,7 @@ GLIBC_TARGET_BOARDS ?= $(shell $(srcdir)/scripts/generate_target_board \ --build-arch-abi "$(GLIBC_MULTILIB_NAMES)" \ --extra-test-arch-abi-flags-list "$(EXTRA_MULTILIB_TEST)") +NEWLIB_TARGET_FLAGS := $(NEWLIB_TARGET_FLAGS_EXTRA) NEWLIB_CC_FOR_TARGET ?= $(NEWLIB_TUPLE)-gcc NEWLIB_CXX_FOR_TARGET ?= $(NEWLIB_TUPLE)-g++ NEWLIB_TARGET_BOARDS ?= $(shell $(srcdir)/scripts/generate_target_board \ @@ -666,7 +667,8 @@ stamps/build-newlib: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/build-gcc-newlib- --enable-newlib-io-c99-formats \ --enable-newlib-register-fini \ CFLAGS_FOR_TARGET="-O2 -D_POSIX_MODE -ffunction-sections -fdata-sections $(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="-O2 -D_POSIX_MODE -ffunction-sections -fdata-sections $(CXXFLAGS_FOR_TARGET)" + CXXFLAGS_FOR_TARGET="-O2 -D_POSIX_MODE -ffunction-sections -fdata-sections $(CXXFLAGS_FOR_TARGET)" \ + $(NEWLIB_TARGET_FLAGS) $(MAKE) -C $(notdir $@) $(MAKE) -C $(notdir $@) install mkdir -p $(dir $@) && touch $@ @@ -690,7 +692,8 @@ stamps/build-newlib-nano: $(NEWLIB_SRCDIR) $(NEWLIB_SRC_GIT) stamps/build-gcc-ne --disable-newlib-supplied-syscalls \ --disable-nls \ CFLAGS_FOR_TARGET="-Os -ffunction-sections -fdata-sections $(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="-Os -ffunction-sections -fdata-sections $(CXXFLAGS_FOR_TARGET)" + CXXFLAGS_FOR_TARGET="-Os -ffunction-sections -fdata-sections $(CXXFLAGS_FOR_TARGET)" \ + $(NEWLIB_TARGET_FLAGS) $(MAKE) -C $(notdir $@) $(MAKE) -C $(notdir $@) install mkdir -p $(dir $@) && touch $@ @@ -137,7 +137,7 @@ devtoolset-7 works. There are a number of additional options that may be passed to configure. See './configure --help' for more details. -Also you can define extra flags to pass to specific projects: ```BINUTILS_NATIVE_FLAGS_EXTRA, BINUTILS_TARGET_FLAGS_EXTRA, GCC_EXTRA_CONFIGURE_FLAGS, GDB_NATIVE_FLAGS_EXTRA, GDB_TARGET_FLAGS_EXTRA, GLIBC_NATIVE_FLAGS_EXTRA, GLIBC_TARGET_FLAGS_EXTRA```. +Also you can define extra flags to pass to specific projects: ```BINUTILS_NATIVE_FLAGS_EXTRA, BINUTILS_TARGET_FLAGS_EXTRA, GCC_EXTRA_CONFIGURE_FLAGS, GDB_NATIVE_FLAGS_EXTRA, GDB_TARGET_FLAGS_EXTRA, GLIBC_TARGET_FLAGS_EXTRA, NEWLIB_TARGET_FLAGS_EXTRA```. Example: ```GCC_EXTRA_CONFIGURE_FLAGS=--with-gmp=/opt/gmp make linux``` #### Set default ISA spec version @@ -468,4 +468,4 @@ you should take care to ensure that both newlib and the external library are bui Errors that indicate a code model mismatch include "relocation overflow" or "relocation truncated" errors from the linker being unable to successfully relocate symbols in the executable. -By default, `riscv-gnu-toolchain` builds newlib with `-mcmodel=medlow`. You can use the alternative `medany` code model (as used in libgloss-htif) by passing `--with-cmodel=medany` to the configure script.
\ No newline at end of file +By default, `riscv-gnu-toolchain` builds newlib with `-mcmodel=medlow`. You can use the alternative `medany` code model (as used in libgloss-htif) by passing `--with-cmodel=medany` to the configure script. |