Skip to content

Commit

Permalink
Add --enable-host-shared configuration option
Browse files Browse the repository at this point in the history
/
	* 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.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203632 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
dmalcolm committed Oct 15, 2013
1 parent 0d19a5c commit 2bd1737
Show file tree
Hide file tree
Showing 27 changed files with 223 additions and 12 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2013-10-15 David Malcolm <dmalcolm@redhat.com>

* configure.ac: Add --enable-host-shared
* configure: Regenerate.

2013-01-10 Joern Rennecke <joern.rennecke@embecosm.com>

Import from savannah.gnu.org:
Expand Down
13 changes: 13 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ enable_option_checking=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
compare_exclusions
host_shared
stage2_werror_flag
stage1_checking
stage1_cflags
Expand Down Expand Up @@ -787,6 +788,7 @@ with_build_time_tools
enable_maintainer_mode
enable_stage1_checking
enable_werror
enable_host_shared
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1490,6 +1492,7 @@ Optional Features:
choose additional checking for stage1 of the
compiler
--enable-werror enable -Werror in bootstrap stage2 and later
--enable-host-shared build host code as shared libraries
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
Expand Down Expand Up @@ -14570,6 +14573,16 @@ case ${enable_werror} in
esac


# Enable --enable-host-shared.
# Check whether --enable-host-shared was given.
if test "${enable_host_shared+set}" = set; then :
enableval=$enable_host_shared; host_shared=$enableval
else
host_shared=no
fi



# Specify what files to not compare during bootstrap.

compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3301,6 +3301,13 @@ case ${enable_werror} in
esac
AC_SUBST(stage2_werror_flag)

# Enable --enable-host-shared.
AC_ARG_ENABLE(host-shared,
[AS_HELP_STRING([--enable-host-shared],
[build host code as shared libraries])],
[host_shared=$enableval], [host_shared=no])
AC_SUBST(host_shared)

# Specify what files to not compare during bootstrap.

compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
Expand Down
14 changes: 14 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 13 additions & 1 deletion gcc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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) \
Expand Down
20 changes: 18 additions & 2 deletions gcc/configure
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@ ac_includes_default="\

ac_subst_vars='LTLIBOBJS
LIBOBJS
PICFLAG
enable_host_shared
enable_plugin
pluginlibs
CLOOGINC
Expand Down Expand Up @@ -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
'
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions gcc/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])],
Expand Down
13 changes: 13 additions & 0 deletions gcc/doc/install.texi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions libbacktrace/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2013-10-15 David Malcolm <dmalcolm@redhat.com>

* configure.ac: Add --enable-host-shared, setting up
pre-existing PIC_FLAG variable within Makefile.am et al.
* configure: Regenerate.

2013-09-20 Alan Modra <amodra@gmail.com>

* configure: Regenerate.
Expand Down
12 changes: 10 additions & 2 deletions libbacktrace/configure
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ with_gnu_ld
enable_libtool_lock
enable_multilib
with_system_libunwind
enable_host_shared
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1369,6 +1370,7 @@ Optional Features:
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-multilib build many library versions (default)
--enable-host-shared build host code as shared libraries
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
Expand Down Expand Up @@ -11087,7 +11089,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11090 "configure"
#line 11092 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
Expand Down Expand Up @@ -11193,7 +11195,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11196 "configure"
#line 11198 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
Expand Down Expand Up @@ -11696,6 +11698,12 @@ PIC_FLAG=
if test -n "${with_target_subdir}"; then
PIC_FLAG=-fPIC
fi
# Similarly, use -fPIC with --enable-host-shared:
# Check whether --enable-host-shared was given.
if test "${enable_host_shared+set}" = set; then :
enableval=$enable_host_shared; PIC_FLAG=-fPIC
fi
# Test for __sync support.
Expand Down
5 changes: 5 additions & 0 deletions libbacktrace/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ PIC_FLAG=
if test -n "${with_target_subdir}"; then
PIC_FLAG=-fPIC
fi
# Similarly, use -fPIC with --enable-host-shared:
AC_ARG_ENABLE(host-shared,
[AS_HELP_STRING([--enable-host-shared],
[build host code as shared libraries])],
[PIC_FLAG=-fPIC], [])
AC_SUBST(PIC_FLAG)

# Test for __sync support.
Expand Down
9 changes: 9 additions & 0 deletions libcpp/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2013-10-15 David Malcolm <dmalcolm@redhat.com>

* Makefile.in (PICFLAG): New.
(ALL_CFLAGS): Add PICFLAG.
(ALL_CXXFLAGS): Likewise.
* configure.ac: Add --enable-host-shared, setting up new
PICFLAG variable.
* configure: Regenerate.

2013-08-07 Richard Earnshaw <rearnsha@arm.com>

* configure.ac: Set need_64bit_hwint for all arm targets.
Expand Down
5 changes: 3 additions & 2 deletions libcpp/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ CCDEPMODE = @CCDEPMODE@
CXXDEPMODE = @CXXDEPMODE@
DEPDIR = @DEPDIR@
NOEXCEPTION_FLAGS = @noexception_flags@
PICFLAG = @PICFLAG@

datarootdir = @datarootdir@
datadir = @datadir@
Expand All @@ -72,9 +73,9 @@ depcomp = $(SHELL) $(srcdir)/../depcomp
INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
-I$(srcdir)/include

ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS) $(PICFLAG)
ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(NOEXCEPTION_FLAGS) $(INCLUDES) \
$(CPPFLAGS)
$(CPPFLAGS) $(PICFLAG)

# The name of the compiler to use.
COMPILER = $(CXX)
Expand Down
13 changes: 13 additions & 0 deletions libcpp/configure
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ ac_includes_default="\
#endif"

ac_subst_vars='LTLIBOBJS
PICFLAG
MAINT
USED_CATALOGS
PACKAGE
Expand Down Expand Up @@ -701,6 +702,7 @@ with_libiconv_prefix
enable_maintainer_mode
enable_checking
enable_canonical_system_headers
enable_host_shared
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1340,6 +1342,7 @@ Optional Features:
other strings
--enable-canonical-system-headers
enable or disable system headers canonicalization
--enable-host-shared build host code as shared libraries
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
Expand Down Expand Up @@ -7204,6 +7207,16 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
esac

# 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



# Output.

ac_config_headers="$ac_config_headers config.h:config.in"
Expand Down
7 changes: 7 additions & 0 deletions libcpp/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ case $target in
[Define to 1 if you can assemble SSE4 insns.])])
esac

# 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(PICFLAG)

# Output.

AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
Expand Down
8 changes: 8 additions & 0 deletions libdecnumber/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2013-10-15 David Malcolm <dmalcolm@redhat.com>

* Makefile.in (PICFLAG): New.
(ALL_CFLAGS): Add PICFLAG.
* configure.ac: Add --enable-host-shared, setting up new
PICFLAG variable.
* configure: Regenerate.

2013-07-09 Simon Baldwin <simonb@google.com>

* configure.ac: Add AC_CONFIG_AUX_DIR.
Expand Down
Loading

0 comments on commit 2bd1737

Please sign in to comment.