[LLVMdev] dragonegg now requires clang

Jack Howarth howarth at bromo.med.uc.edu
Sun Dec 9 08:08:00 PST 2012


On Fri, Dec 07, 2012 at 06:57:36PM +0100, Duncan Sands wrote:
> Hi Jack, can you please open a bug report asking that llvm-config only
> provide the minimum set of flags needed to compile code that interfaces
> with LLVM, rather than (as now) all kinds of unneeded flags such as -g
> and warnings.
>
> Thanks, Duncan.
>

Duncan,
   I have opened http://llvm.org/bugs/show_bug.cgi?id=14539 for this issue.
In the meanwhile, can apply the attached patch for the dragonegg 3.2 release?
Since dragonegg is designed to run under FSF gcc, it seems logical that users
will assume that it can be compiled under the same FSF gcc compiler.
         Jack

>>>
>>> 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
>>>>
-------------- next part --------------
Index: Makefile
===================================================================
--- Makefile	(revision 169698)
+++ Makefile	(working copy)
@@ -42,8 +42,8 @@ COMMON_FLAGS+=-DENABLE_LLVM_PLUGINS
 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 @@ TARGET_UTIL=./TargetInfo
 
 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)\" \


More information about the llvm-dev mailing list