[LLVMbugs] [Bug 6835] New: Makefiles.rules wrong handling of CXXFLAGS

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 14 12:04:56 CDT 2010


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

           Summary: Makefiles.rules wrong handling of CXXFLAGS
           Product: Build scripts
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Makefiles
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: julien.etienne at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Hello,

There is a mistake in the current Makefile.rules file leading to the
propagation of -fno-rtti gcc option even when it should not be set.

To reproduce the issue:
1- Get llvm trunk (I am at revision 101257)
2- Set the CXXFLAGS variable in your environment, for example:
export CXXFLAGS="-O2 -pipe -march=native"
3- Launch configure: ./configure
4- Launch make: make

You should get an error like this:
[...]
make[2]: Entering directory `/home/julien/src/llvm/utils/TableGen'
llvm[2]: Compiling ARMDecoderEmitter.cpp for Debug build
In file included from ARMDecoderEmitter.cpp:21:
Record.h: In constructor ‘llvm::VarBitInit::VarBitInit(llvm::TypedInit*,
unsigned int)’:
Record.h:980: error: ‘dynamic_cast’ not permitted with -fno-rtti
Record.h: In constructor
‘llvm::VarListElementInit::VarListElementInit(llvm::TypedInit*, unsigned int)’:
Record.h:1003: error: ‘dynamic_cast’ not permitted with -fno-rtti
Record.h:1005: error: ‘dynamic_cast’ not permitted with -fno-rtti
ARMDecoderEmitter.cpp: In function ‘bit_value_t bitFromBits(llvm::BitsInit&,
unsigned int)’:
ARMDecoderEmitter.cpp:188: error: ‘dynamic_cast’ not permitted with -fno-rtti
make[2]: *** [/home/julien/src/llvm/utils/TableGen/Debug/ARMDecoderEmitter.o]
Error 1
make[2]: Leaving directory `/home/julien/src/llvm/utils/TableGen'
make[1]: *** [TableGen/.makeall] Error 2
make[1]: Leaving directory `/home/julien/src/llvm/utils'
make: *** [all] Error 1

This is caused by the option -fno-rtti that should not be set as
TableGen/Makefile contains "REQUIRES_RTTI := 1".

This is due to a mistake in Makefile.rules that can be fixed with the following
patch:
--- Makefile.rules      2010-04-14 18:44:09.882395333 +0200
+++ Makefile.rules.fixed        2010-04-14 18:43:56.371458018 +0200
@@ -388,7 +388,6 @@
 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
 ifneq ($(REQUIRES_RTTI), 1)
   CXX.Flags += -fno-rtti
-  CXXFLAGS += -fno-rtti
 endif

 ifdef ENABLE_COVERAGE

The CXXFLAGS should not be set here, CXX.Flags is enough.
With this patch the REQUIRES_RTTI behavior is fine.

Best Regards,
Julien

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


More information about the LLVMbugs mailing list