This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

mknumeric_limits



What's the point behind this code in mknumeric_limits:

case `uname` in
    CYGWIN*)
        LDFLAGS='-nodefaultlibs -lcygwin -lc -lkernel32 -lgcc' ;;
    AIX*)
        case $CXX in
            *pthread*)
                LDFLAGS='-nodefaultlibs -lgcc -L/usr/lib/threads -lpthreads 
-lc_
r /usr/lib/libc.a' ;;
            *)
                LDFLAGS='-nodefaultlibs -lgcc -lc' ;;
        esac
        ;;
    *)
        LDFLAGS='-nodefaultlibs -lgcc -lc' ;;
esac


First, it seems rather odd to be using "uname" like that, unless this code
is supposed to be run on the build machine.

Second, by using uname instead of a triplet, we lose the ability to
select behavior on the triplet.  This is important when you consider
systems like the PA which have two completely different toolchains that
can not interoperate with each other.

Third, what's the purpose behind -nodefaultlibs, then listing the libraries
you want explicitly?  If we're really just building something for the
build system, why not let the compiler figure out what libraries need to
be linked to create an executable?

The reason I'm looking at this code is I need to make it do something
slightly different for the PA64 toolchain (but not for the PA32 toolchain)
and there is no way you can tell which one you're using by running uname.

jeff



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