Browse Source

Add the "--with-cmodel" configure argument

This lets users select the code model when building the tools.
pull/229/head
Palmer Dabbelt 9 years ago
parent
commit
f250fe9732
  1. 4
      Makefile.in
  2. 21
      configure
  3. 10
      configure.ac

4
Makefile.in

@ -44,8 +44,8 @@ ifeq ($(MULTILIB_NAMES),)
MULTILIB_NAMES := $(XLEN)
endif
CFLAGS_FOR_TARGET := $(CFLAGS_FOR_TARGET_EXTRA)
ASFLAGS_FOR_TARGET := $(ASFLAGS_FOR_TARGET_EXTRA)
CFLAGS_FOR_TARGET := $(CFLAGS_FOR_TARGET_EXTRA) @cmodel@
ASFLAGS_FOR_TARGET := $(ASFLAGS_FOR_TARGET_EXTRA) @cmodel@
GLIBC_TARGET_FLAGS := $(GLIBC_TARGET_FLAGS_EXTRA)
GLIBC_CC_FOR_TARGET ?= riscv$(XLEN)-unknown-linux-gnu-gcc
GLIBC_CXX_FOR_TARGET ?= riscv$(XLEN)-unknown-linux-gnu-g++

21
configure

@ -584,6 +584,7 @@ PACKAGE_URL=''
ac_subst_vars='LTLIBOBJS
LIBOBJS
cmodel
gcc_checking
multilib_names
multilib_flags
@ -655,6 +656,7 @@ with_arch
with_abi
enable_multilib
enable_gcc_checking
with_cmodel
'
ac_precious_vars='build_alias
host_alias
@ -1299,6 +1301,8 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-arch=rv64imafdc Sets the base RISC-V ISA, defaults to rv64imafdc
--with-abi=lp64d Sets the base RISC-V ABI, defaults to lp64d
--with-cmodel Select the code model to use when building libc and
libgcc [--with-cmodel=medlow]
Some influential environment variables:
CC C compiler command
@ -3304,6 +3308,23 @@ else
fi
# Check whether --with-cmodel was given.
if test "${with_cmodel+set}" = set; then :
withval=$with_cmodel;
else
enable_gcc_checking=yes
fi
if test "x$with_cmodel" != x; then :
cmodel=-mcmodel=$with_cmodel
else
cmodel=-mcmodel=medlow
fi
ac_config_files="$ac_config_files Makefile"
ac_config_files="$ac_config_files scripts/wrapper/awk/awk"

10
configure.ac

@ -110,6 +110,16 @@ AS_IF([test "x$enable_gcc_checking" != xno],
[AC_SUBST(gcc_checking, --enable-checking=yes)],
[AC_SUBST(gcc_checking, --enable-checking=release)])
AC_ARG_WITH(cmodel,
[AS_HELP_STRING([--with-cmodel],
[Select the code model to use when building libc and libgcc @<:@--with-cmodel=medlow@:>@])],
[],
[enable_gcc_checking=yes]
)
AS_IF([test "x$with_cmodel" != x],
[AC_SUBST(cmodel, -mcmodel=$with_cmodel)],
[AC_SUBST(cmodel, -mcmodel=medlow)])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([scripts/wrapper/awk/awk], [chmod +x scripts/wrapper/awk])
AC_CONFIG_FILES([scripts/wrapper/sed/sed], [chmod +x scripts/wrapper/sed])

Loading…
Cancel
Save