[LLVMdev] dragonegg now requires clang

Jack Howarth howarth at bromo.med.uc.edu
Fri Dec 7 09:55:29 PST 2012


On Fri, Dec 07, 2012 at 06:20:37PM +0100, Duncan Sands wrote:
> Hi Jack, this occurs because you compiled LLVM with clang (right?) and
> dragonegg is compiled with the same flags used to compile LLVM (it is
> an llvm-config bug in my opinion that llvm-config output includes these
> kinds of optional flags).

Duncan,
   Yes. I believe both fink and MacPorts now default to the clang compiler
on later darwin. The following change to the dragonegg 3.2 Makefile solves
the problem here...

--- dragonegg-3.2/Makefile.orig 2012-12-07 12:50:30.000000000 -0500
+++ dragonegg-3.2/Makefile      2012-12-07 12:51:21.000000000 -0500
@@ -42,8 +42,8 @@
 else
 COMMON_FLAGS+=-fvisibility=hidden
 endif
-CFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cflags)
-CXXFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cxxflags)
+CFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cflags | sed -e 's/-Wcovered-switch-default//')
+CXXFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cxxflags | sed -e 's/-Wcovered-switch-default//')
 
 ifeq ($(shell uname),Darwin)
 LOADABLE_MODULE_OPTIONS=-bundle -undefined dynamic_lookup
@@ -76,7 +76,7 @@
 
 ALL_OBJECTS=$(PLUGIN_OBJECTS) $(TARGET_OBJECT) $(TARGET_UTIL_OBJECTS)
 
-CPP_OPTIONS+=$(CPPFLAGS) $(shell $(LLVM_CONFIG) --cppflags) \
+CPP_OPTIONS+=$(CPPFLAGS) $(shell $(LLVM_CONFIG) --cppflags | sed -e 's/-Wcovered-switch-default//') \
             -fno-rtti \
             -MD -MP \
             -DIN_GCC -DLLVM_VERSION=\"$(LLVM_VERSION)\" \

so that FSF gcc 4.7.2 can be used to build dragonegg again.
         Jack

>
> Ciao, Duncan.
>
> On 07/12/12 18:11, Jack Howarth wrote:
>> Duncan,
>>     I am unable to complile dragonegg 3.2 with FSF gcc 4.7 due the the
>> compiler errors...
>>
>> GCC=/sw/lib/gcc4.7/bin/gcc-4 LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config VERBOSE=1 ENABLE_LLVM_PLUGINS=1 make CPPFLAGS="-g -DENABLE_LTO -I/sw/include"
>> /sw/lib/gcc4.7/bin/gcc-4 --version > /dev/null
>> /sw/opt/llvm-3.2/bin/llvm-config --version > /dev/null
>> Compiling utils/TargetInfo.cpp
>> /sw/lib/gcc4.7/bin/g++-4 -c -DTARGET_TRIPLE=\"x86_64-apple-darwin12.2.0\" \
>> 	-g -DENABLE_LTO -I/sw/include -I/sw/opt/llvm-3.2/include    -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -Wcovered-switch-default -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -MD -MP -DIN_GCC -DLLVM_VERSION=\"3.2svn\" -DGCC_MAJOR=4 -DGCC_MINOR=7 -DGCC_MICRO=2 -I/sw/src/fink.build/dragonegg-gcc47-3.2-0/dragonegg-3.2/include -isystem/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin12.2.0/4.7.2/plugin/include -Wall -Wextra -DENABLE_LLVM_PLUGINS -I/sw/opt/llvm-3.2/include  -fPIC -fvisibility-inlines-hidden -g  -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -Wcovered-switch-default -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /sw/src/fink.build/dragonegg-gcc47-3.2-0/dragonegg-3.2/utils/TargetInfo.cpp
>> g++-4: error: unrecognized command line option '-Wcovered-switch-default'
>> g++-4: error: unrecognized command line option '-Wcovered-switch-default'
>> make: *** [TargetInfo.o] Error 1
>>
>> Have you noticed this issue on linux? It seems to introduce an unwanted compiler dependency for building
>> dragonegg.
>>        Jack
>>



More information about the llvm-dev mailing list