This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SHARED_MODE patch for gcc


Hello,

I build my software with crosstool's configuration glibc 2.2.2 & gcc 4.1.1 to get portable c++ linux binaries. I have modified crosstool slightly, so it is possible to build a version of g++, which links dynamically to glibc related libraries but links libgcc & libstdc++ statically. Maybe the patch is of general interest, so I am submitting it here. To use the new functionality, put GCC_SHARED_MODE=--disable-shared in the configuration. Hacks like http://www.trilithium.com/johan/2005/06/static-libstdc/ can now be avoided.

--- crosstool-0.43/crosstool.sh.orig 2007-01-10 22:12:13.000000000 +0100
+++ crosstool-0.43/crosstool.sh 2007-01-10 22:17:51.000000000 +0100
@@ -62,6 +62,7 @@
test -z "${KERNELCONFIG}" && test ! -f ${LINUX_DIR}/.config && echo "KERNELCONFIG not set, and no .config file found, so not configuring linux kernel"
test -z "${KERNELCONFIG}" || test -r "${KERNELCONFIG}" || abort "Can't read file KERNELCONFIG = $KERNELCONFIG, please fix."
test -z "${SHARED_MODE}" && SHARED_MODE="--enable-shared" && echo "SHARED_MODE not set, so defaulting to --enable-shared"
+test -z "${GCC_SHARED_MODE}" && GCC_SHARED_MODE="${SHARED_MODE}" && echo "GCC_SHARED_MODE not set, so defaulting to ${SHARED_MODE}"
test -z "${GCC_LANGUAGES}" && echo "GCC_LANGUAGES not set, assuming c,c++"
GCC_LANGUAGES=${GCC_LANGUAGES-"c,c++"}
TOP_DIR=${TOP_DIR-`pwd`}
@@ -143,6 +144,7 @@
GCC_EXTRA_CONFIG \
GCC_HOST \
GCC_LANGUAGES \
+GCC_SHARED_MODE \
GDB_DIR \
GLIBC_ADDON_OPTIONS \
GLIBC_DIR \
@@ -610,7 +612,7 @@
--enable-symvers=gnu \
--enable-__cxa_atexit \
--enable-languages="$GCC_LANGUAGES" \
- $SHARED_MODE \
+ $GCC_SHARED_MODE \
--enable-c99 \
--enable-long-long
fi



Regards, Egon Kocjan
--- crosstool-0.43/crosstool.sh.orig	2007-01-10 22:12:13.000000000 +0100
+++ crosstool-0.43/crosstool.sh	2007-01-10 22:17:51.000000000 +0100
@@ -62,6 +62,7 @@
 test -z "${KERNELCONFIG}" && test ! -f ${LINUX_DIR}/.config  && echo  "KERNELCONFIG not set, and no .config file found, so not configuring linux kernel"
 test -z "${KERNELCONFIG}" || test -r "${KERNELCONFIG}"  || abort  "Can't read file KERNELCONFIG = $KERNELCONFIG, please fix."
 test -z "${SHARED_MODE}" && SHARED_MODE="--enable-shared" && echo "SHARED_MODE not set, so defaulting to --enable-shared"
+test -z "${GCC_SHARED_MODE}" && GCC_SHARED_MODE="${SHARED_MODE}" && echo "GCC_SHARED_MODE not set, so defaulting to ${SHARED_MODE}"
 test -z "${GCC_LANGUAGES}"         && echo "GCC_LANGUAGES not set, assuming c,c++"
 GCC_LANGUAGES=${GCC_LANGUAGES-"c,c++"}
 TOP_DIR=${TOP_DIR-`pwd`}
@@ -143,6 +144,7 @@
 GCC_EXTRA_CONFIG \
 GCC_HOST \
 GCC_LANGUAGES \
+GCC_SHARED_MODE \
 GDB_DIR \
 GLIBC_ADDON_OPTIONS \
 GLIBC_DIR \
@@ -610,7 +612,7 @@
         --enable-symvers=gnu \
         --enable-__cxa_atexit \
         --enable-languages="$GCC_LANGUAGES" \
-         $SHARED_MODE \
+         $GCC_SHARED_MODE \
         --enable-c99 \
         --enable-long-long
 fi
--
For unsubscribe information see http://sourceware.org/lists.html#faq

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]