This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: compiling glibc with a compiler flag
Hi Jakub and Thank You for the Help,
On 4/14/07, Jakub Jelinek <jakub@redhat.com> wrote:
On Sat, Apr 14, 2007 at 11:54:40AM +0300, Metuki Sabhe wrote:
> How can I compile glibc with some additional compiler flags ?
Just tell it to configure, say:
CC=gcc CXX=g++ CFLAGS="-g -O2 -mtune=generic -DNDEBUG=1" \
../configure --prefix=/usr --enable-add-ons=nptl,libidn \
--without-cvs --enable-kernel=2.6.9 --with-headers=/usr/include \
--enable-bind-now --with-tls --with-__thread --build x86_64-redhat-linux \
--host x86_64-redhat-linux
If I understand correctly, doing so will override the CFLAGS that were meant
to be passed originally. How do I know I don't break things ? For example,
I tried:
CFLAGS="-g" ../glibc-2.5/configure
but during make it shouted it cannot be compiled without optimizations,
so now I'm trying:
CFLAGS="-O2 -g" ../glibc-2.5/configure
but how do I know I'm not breaking something else ? even worse, maybe some
parts of the glibc needs X flags and some other parts need Y flags ?
Ideally I would just *add* arbitrary flag, and not override them all..
But maybe I'm just over-paranoid here and the only problem is the missing -O2
flag.. ?
Thank You again !
metuki
Jakub