problem compiling with -O2 flag gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've googled for any answers to this and have come up dry.  My problem is
with gcc 4.3-39.1 building the source of bash.  I've localized it down to
when bash tries to build it's own version of malloc it fails because the
glibc version of malloc and bash's version have different declarations so I
get this snippet from the compile output:
......
make[1]: Entering directory
`/net/frost/export/u2/wmotycka/bash/source/lib/malloc'
gcc  -I. -I../.. -I../.. -I../../lib -DHAVE_CONFIG_H -DSHELL  -g -O2
-DRCHECK -Dbotch=programming_error -D_LARGEFILE64_SOURCE -c malloc.c
malloc.c:522: error: conflicting types for ‘malloc’
malloc.c: In function ‘free’:
malloc.c:645: warning: argument ‘mem’ doesn’t match built-in prototype
malloc.c: At top level:
malloc.c:701: warning: conflicting types for built-in function ‘realloc’
malloc.c: In function ‘memalign’:
malloc.c:773: warning: cast from pointer to integer of different size
malloc.c:776: warning: cast from pointer to integer of different size
malloc.c:776: warning: cast to pointer from integer of different size
malloc.c: At top level:
malloc.c:803: error: conflicting types for ‘calloc’
make[1]: *** [malloc.o] Error 1
make[1]: Leaving directory
`/net/frost/export/u2/wmotycka/bash/source/lib/malloc'
make: *** [lib/malloc/libmalloc.a] Error 1

This problem vanishes once I compile without the -O2 option to gcc and I'm
trying to figure out why.  I can build this on a Sun Solaris 5.9 system (our
antique server) with -O2 set.  Any thoughts by my esteemed and learned
comrades on what may be the cause of this malady?
Thanks
Wayne
-- 
View this message in context: http://www.nabble.com/problem-compiling-with--O2-flag-gcc-tp20964192p20964192.html
Sent from the gcc - Help mailing list archive at Nabble.com.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux