This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: problem compiling with -O2 flag gcc


Wayne,

See the NOTES file in the top level source directory of the bash tarball.

It is recommended to configure linux with --without-gnu-malloc (or if you prefer --without-bash-malloc).  It will then use glibc's malloc.

I don't think your issue is gcc related.

Hope this helps,

Harvey

----- Original Message ----
> From: waynemot <waynemot@msn.com>
> To: gcc-help@gcc.gnu.org
> Sent: Thursday, December 11, 2008 3:42:15 PM
> Subject: problem compiling with -O2 flag gcc
> 
> 
> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]