Closed simonjwright closed 4 years ago
"new" is a standard C++ include, I guess you need to e.g. setup the Apple SDK to point to the right place. This is really unrelated to building GNAT LLVM: you would have the same issue compiling any C++ file depending on the C++ "new" include and clang++.
Quite so.
You’d’ve thought that, following the work here I’d’ve been more aware that most of the problems introduced by Apple’s SDK changes.
But that’s not the whole story: it turns out, from looking at what Apple’s clang++ does, that the C++ headers are in /usr/include/c++/v1
(or the equivalent place under the SDK).
I don’t know how to build clang to incorporate this knowledge, so I’ve modified llvm-interface/Makefile
to add it:
--- a/llvm-interface/Makefile
+++ b/llvm-interface/Makefile
@@ -33,6 +33,7 @@ endif
LDFLAGS=$(shell $(LLVM_CONFIG) --libs all --ldflags --system-libs) \
-static-libstdc++
CXXFLAGS=$(shell $(LLVM_CONFIG) --cxxflags)
+CXXFLAGS += -I/Library/Developer/CommandLineTools/usr/include/c++/v1
ifeq ($(filter-out CYGWIN% MINGW%,$(uname)),)
LN_S=cp -p
OK, glad to hear that you found a way forward, thank you for sharing the info! What we'll do is to allow overriding the CXXFLAGS make variable on the command line so that you can do: make CXXFLAGS="-I/Library/..." without having to modify the Makefile
Perhaps EXTRA_CXXFLAGS
?
That was my initial thought as well, but CXXFLAGS is really intended for that, so I'll make CXXFLAGS empty by default and user overridable, and use ALL_CXXFLAGS internally instead, watch for the commit soon if you're curious :-)
I’ve tried building LLVM from llvm-project; branch
master
with GCC 9.1.0, tagllvmorg-8.01
with GCC 9.1.0, GNAT CE 2019, and the standard CommandLineTools; all fail building gnat_llvm withAny thoughts welcome (aside from using "brew", please)