[LLVMbugs] [Bug 6389] New: LLVM build system ignores compilation flags given to ./configure script

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 22 08:57:16 PST 2010


http://www.llvm.org/bugs/show_bug.cgi?id=6389

           Summary: LLVM build system ignores compilation flags given to
                    ./configure script
           Product: Build scripts
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Makefiles
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: yann at droneaud.fr
                CC: llvmbugs at cs.uiuc.edu
   Estimated Hours: 0.0


While trying to add flags to build LLVM with gcc's atomic builtins, I've found
that LLVM makefile don't make any use of flags given to ./configure such as:

./configure CXXFLAGS="-O2 -g -march=native" CFLAGS="-O2 -g -march=native"

Without any -march flags, gcc is building for i386 architecture by default on
my system and atomics functions are not available,  so I need to add such flags
in order to ./configure script to found gcc's atomic builtins.

But those flags are also needed later in build, otherwise LLVM build failed,
for example:

llvm/Debug+Checks/lib/libLLVMSystem.a(Atomic.o): In function
`llvm::sys::AtomicAdd(unsigned int volatile*, unsigned int)':
llvm/lib/System/Atomic.cpp:86: undefined reference to `__sync_add_and_fetch_4'
llvm/Debug+Checks/lib/libLLVMSystem.a(Atomic.o): In function
`llvm::sys::AtomicDecrement(unsigned int volatile*)':
llvm/lib/System/Atomic.cpp:73: undefined reference to `__sync_sub_and_fetch_4'
llvm/Debug+Checks/lib/libLLVMSystem.a(Atomic.o): In function
`llvm::sys::CompareAndSwap(unsigned int volatile*, unsigned int, unsigned
int)':
llvm/lib/System/Atomic.cpp:47: undefined reference to
`__sync_val_compare_and_swap_4'

The build system uses those flags, without the ones specified on ./configure
command line:

g++ -g -fPIC -Woverloaded-virtual -pedantic -Wno-long-long -Wall -W
-Wno-unused-parameter -Wwrite-strings

-- 
Configure bugmail: http://www.llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are watching all bug changes.



More information about the llvm-bugs mailing list