diff options
author | David Malcolm <dmalcolm@redhat.com> | 2013-10-15 20:33:55 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2013-10-15 20:33:55 +0000 |
commit | 459260ecf8b420b029601a664cdb21c185268ecb (patch) | |
tree | b101be713129409fe69e45a4e5436995f481906a /gcc | |
parent | 37ea0d87a36e36b706fb32491118e0da2a530099 (diff) | |
download | gcc-459260ecf8b420b029601a664cdb21c185268ecb.zip gcc-459260ecf8b420b029601a664cdb21c185268ecb.tar.gz gcc-459260ecf8b420b029601a664cdb21c185268ecb.tar.bz2 |
Add --enable-host-shared configuration option
/
* configure.ac: Add --enable-host-shared
* configure: Regenerate.
gcc/
* Makefile.in (PICFLAG): New.
(enable_host_shared): New.
(INTERNAL_CFLAGS): Use PICFLAG.
(LIBIBERTY): Use pic build of libiberty.a if configured with
--enable-host-shared.
* configure.ac: Add --enable-host-shared, setting up new
PICFLAG variable.
* configure: Regenerate.
* doc/install.texi (--enable-shared): Add note contrasting it
with...
(--enable-host-shared): New option.
libbacktrace/
* configure.ac: Add --enable-host-shared, setting up
pre-existing PIC_FLAG variable within Makefile.am et al.
* configure: Regenerate.
libcpp/
* Makefile.in (PICFLAG): New.
(ALL_CFLAGS): Add PICFLAG.
(ALL_CXXFLAGS): Likewise.
* configure.ac: Add --enable-host-shared, setting up new
PICFLAG variable.
* configure: Regenerate.
libdecnumber/
* Makefile.in (PICFLAG): New.
(ALL_CFLAGS): Add PICFLAG.
* configure.ac: Add --enable-host-shared, setting up new
PICFLAG variable.
* configure: Regenerate.
libiberty/
* configure.ac: If --enable-host-shared, use -fPIC.
* configure: Regenerate.
zlib/
* configure.ac: Add --enable-host-shared, setting up new
PICFLAG variable.
* Makefile.am: Add PICFLAG to libz_a_CFLAGS.
* Makefile.in: Regenerate.
* configure: Regenerate.
From-SVN: r203632
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/Makefile.in | 14 | ||||
-rwxr-xr-x | gcc/configure | 20 | ||||
-rw-r--r-- | gcc/configure.ac | 9 | ||||
-rw-r--r-- | gcc/doc/install.texi | 13 |
5 files changed, 67 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c3c209d..60e76c1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2013-10-15 David Malcolm <dmalcolm@redhat.com> + + * Makefile.in (PICFLAG): New. + (enable_host_shared): New. + (INTERNAL_CFLAGS): Use PICFLAG. + (LIBIBERTY): Use pic build of libiberty.a if configured with + --enable-host-shared. + * configure.ac: Add --enable-host-shared, setting up new + PICFLAG variable. + * configure: Regenerate. + * doc/install.texi (--enable-shared): Add note contrasting it + with... + (--enable-host-shared): New option. + 2013-10-15 Richard Biener <rguenther@suse.de> * tree-tailcall.c (find_tail_calls): Don't use tail-call recursion diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 24c8fed..ba39ac9 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -135,6 +135,9 @@ CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ LDFLAGS = @LDFLAGS@ +# Should we build position-independent host code? +PICFLAG = @PICFLAG@ + # Flags to determine code coverage. When coverage is disabled, this will # contain the optimization flags, as you normally want code coverage # without optimization. @@ -346,6 +349,8 @@ PLUGINLIBS = @pluginlibs@ enable_plugin = @enable_plugin@ +enable_host_shared = @enable_host_shared@ + CPPLIB = ../libcpp/libcpp.a CPPINC = -I$(srcdir)/../libcpp/include @@ -955,7 +960,7 @@ CONTEXT_H = context.h # programs built during a bootstrap. # autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a # cross compiler which does not use the native headers and libraries. -INTERNAL_CFLAGS = -DIN_GCC @CROSS@ +INTERNAL_CFLAGS = -DIN_GCC $(PICFLAG) @CROSS@ # This is the variable actually used when we compile. If you change this, # you probably want to update BUILD_CFLAGS in configure.ac @@ -978,8 +983,15 @@ ALL_COMPILERFLAGS = $(ALL_CXXFLAGS) ALL_LINKERFLAGS = $(ALL_CXXFLAGS) # Build and host support libraries. + +# Use the "pic" build of libiberty if --enable-host-shared. +ifeq ($(enable_host_shared),yes) +LIBIBERTY = ../libiberty/pic/libiberty.a +BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/pic/libiberty.a +else LIBIBERTY = ../libiberty/libiberty.a BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a +endif # Dependencies on the intl and portability libraries. LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \ diff --git a/gcc/configure b/gcc/configure index 4d12a21..bedf3b1 100755 --- a/gcc/configure +++ b/gcc/configure @@ -600,6 +600,8 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +PICFLAG +enable_host_shared enable_plugin pluginlibs CLOOGINC @@ -921,6 +923,7 @@ enable_maintainer_mode enable_link_mutex enable_version_specific_runtime_libs enable_plugin +enable_host_shared enable_libquadmath_support with_linker_hash_style ' @@ -1636,6 +1639,7 @@ Optional Features: specify that runtime libraries should be installed in a compiler-specific directory --enable-plugin enable plugin support + --enable-host-shared build host code as shared libraries --disable-libquadmath-support disable libquadmath support for Fortran @@ -17893,7 +17897,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17896 "configure" +#line 17900 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17999,7 +18003,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18002 "configure" +#line 18006 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -27700,6 +27704,18 @@ $as_echo "#define ENABLE_PLUGIN 1" >>confdefs.h fi +# Enable --enable-host-shared +# Check whether --enable-host-shared was given. +if test "${enable_host_shared+set}" = set; then : + enableval=$enable_host_shared; PICFLAG=-fPIC +else + PICFLAG= +fi + + + + + # Check whether --enable-libquadmath-support was given. if test "${enable_libquadmath_support+set}" = set; then : enableval=$enable_libquadmath_support; ENABLE_LIBQUADMATH_SUPPORT=$enableval diff --git a/gcc/configure.ac b/gcc/configure.ac index f216962..5111109 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -5399,6 +5399,15 @@ if test x"$enable_plugin" = x"yes"; then fi +# Enable --enable-host-shared +AC_ARG_ENABLE(host-shared, +[AS_HELP_STRING([--enable-host-shared], + [build host code as shared libraries])], +[PICFLAG=-fPIC], [PICFLAG=]) +AC_SUBST(enable_host_shared) +AC_SUBST(PICFLAG) + + AC_ARG_ENABLE(libquadmath-support, [AS_HELP_STRING([--disable-libquadmath-support], [disable libquadmath support for Fortran])], diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 7be8e5a..5cb4d3c 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -925,6 +925,19 @@ Use @option{--disable-shared} to build only static libraries. Note that @option{--disable-shared} does not accept a list of package names as argument, only @option{--enable-shared} does. +Contrast with @option{--enable-host-shared}, which affects @emph{host} +code. + +@item --enable-host-shared +Specify that the @emph{host} code should be built into position-independent +machine code (with -fPIC), allowing it to be used within shared libraries, +but yielding a slightly slower compiler. + +Currently this option is only of use to people developing GCC itself. + +Contrast with @option{--enable-shared}, which affects @emph{target} +libraries. + @item @anchor{with-gnu-as}--with-gnu-as Specify that the compiler should assume that the assembler it finds is the GNU assembler. However, this does not modify |