This is the mail archive of the crossgcc@sources.redhat.com 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]

Re: crosstool configure confusion re __cxa_atexit


> > I'm not sure whether this is from vanilla crosstool or Carl's uclibc 
> > patches,
> 
> A bit of both actually.

Yep, looks like I'm complicit in that one.

> > but I notice that configure was told to both disable and enable 
> > __cxa_atexit. That doesn't seem wise to me:
> > 
> > [charlieb@pc-00085 gcc-3.3.2-uClibc-0.9.23]$ cat build-gcc/config.status
> > #!/bin/sh
> > # This file was generated automatically by configure.  Do not edit.
> > # This directory was configured as follows:
> > /home/charlieb/rpms/BUILD/crosstool-0.25/build/mipsel-unknown-linux-uclibc/gcc-3.3.2-uClibc-0.9.23/gcc-3.3.2/configure 
> > --with-gcc-version-trigger=/home/charlieb/rpms/BUILD/crosstool-0.25/build/mipsel-unknown-linux-uclibc/gcc-3.3.2-uClibc-0.9.23/gcc-3.3.2/gcc/version.c 
> > --target=mipsel-unknown-linux-uclibc --host=i686-host_pc-linux-gnu 
> > --prefix=/opt/crosstool/mipsel-unknown-linux-uclibc/gcc-3.3.2-uClibc-0.9.23 
> > --disable-__cxa_atexit 
> > --with-headers=/opt/crosstool/mipsel-unknown-linux-uclibc/gcc-3.3.2-uClibc-0.9.23/mipsel-unknown-linux-uclibc/include 
> > --disable-nls --enable-threads=posix --enable-symvers=gnu 
> > --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared 
> > --enable-c99 --enable-long-long --norecursion 
> 
> This comes from the interpolation of $(GCC_EXTRA_CONFIG) in the final gcc 
> configure run, but with the interpolation happening just after --prefix, 
> IOW, quite early in the command line. I assume that in this case the 
> attempt to disable __cxa_atexit for the uclibc build will be ineffective.
> 
> Is there any reason not to have $(GCC_EXTRA_CONFIG) last?

Not that I can think of.  In fact, I thought my uclibc-compatibility patch
did so.

> And should the 
> existing args by explicit in-line, or should they be set by other 
> variables. We have a bunch of stuff listed which may not be appropriate 
> for all targets which might be supported:
> 
>     ${GCC_DIR}/configure --target=$TARGET --host=$HOST --prefix=$PREFIX \
>         ${GCC_EXTRA_CONFIG} \
>         --with-headers=${PREFIX}/${TARGET}/include \
>         --disable-nls \
>         --enable-threads=posix \
>         --enable-symvers=gnu \
>         --enable-__cxa_atexit \
>         --enable-languages=c,c++ \
>         --enable-shared \
>         --enable-c99 \
>         --enable-long-long

Not only may all of those not be appropriate for all targets, some may be
contradicted by the user-supplied GCC_EXTRA_CONFIG.  I'd rather not give
two contradicting directives to configure, even if we make sure the last
one is "the right one".  Here's my stab at addressing this...   (Note this
patch is against the crosstool I'm actively using, which is 0.25 plus my
common-source and uclibc-support patches.)  As people determine which
options are not apporpriate for which targets, they can move those options
out of the initial definition of GCC_DEFAULT_OPTIONS into the conditionaled
add-ons.

                               -----Carl


{Tossing another one onto Dan's queue...}

Index: crosstool.sh
===================================================================
RCS file: /home/cvs/tools/crosstool-0.25/crosstool.sh,v
retrieving revision 1.6
diff -d -u -r1.6 crosstool.sh
--- crosstool.sh	20 Dec 2003 00:35:17 -0000	1.6
+++ crosstool.sh	8 Jan 2004 01:57:57 -0000
@@ -421,11 +421,6 @@
         CROSS=${TARGET}- PREFIX=${PREFIX}/${TARGET}/ \
             make all install
 
-        # This is perhaps a hokey place to do this, but uClibc does not
-        # support __cxa_atexit, and gcc does not seem to recognize this
-        # on its own.  Disable it before we try to build the final compiler.
-        GCC_EXTRA_CONFIG="$GCC_EXTRA_CONFIG --disable-__cxa_atexit"
-
         ;;
 
 esac
@@ -444,16 +439,30 @@
     # --disable-nls to work around crash bug on ppc405, but also because embedded
     # systems don't really need message catalogs...
     # Use --with-headers, else it will define disable_glibc while building libgcc, and you'll have no profiling
+    GCC_DEFAULT_OPTIONS="--disable-nls \
+                         --enable-threads=posix \
+                         --enable-symvers=gnu \
+                         --enable-languages=c,c++ \
+                         --enable-shared \
+                         --enable-c99 \
+                         --enable-long-long"
+    case ${C_LIBRARY} in
+        glibc)
+            GCC_DEFAULT_OPTIONS="$GCC_DEFAULT_OPTIONS --enable-__cxa_atexit"
+            ;;
+        *)
+            GCC_DEFAULT_OPTIONS="$GCC_DEFAULT_OPTIONS --disable-__cxa_atexit"
+            ;;
+    esac
+    for GCC_DEFAULT_OPTION in $GCC_DEFAULT_OPTIONS ; do
+        GCC_SEARCH_OPTION=`echo "$GCC_DEFAULT_OPTION" | sed -e 's/^--en//' \
+            -e 's/^--dis//' -e 's/=.*//'`
+        if echo "$GCC_EXTRA_CONFIG" | grep -v "$GCC_SEARCH_OPTION"; then
+            GCC_EXTRA_CONFIG="$GCC_EXTRA_CONFIG $GCC_DEFAULT_OPTION"
+        fi
+    done
     ${GCC_DIR}/configure --target=$TARGET --host=$HOST --prefix=$PREFIX \
         --with-headers=${PREFIX}/${TARGET}/include \
-	--disable-nls \
-	--enable-threads=posix \
-	--enable-symvers=gnu \
-	--enable-__cxa_atexit \
-        --enable-languages=c,c++ \
-	--enable-shared \
-	--enable-c99 \
-        --enable-long-long \
         ${GCC_EXTRA_CONFIG}
 fi
 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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