Closed simonjwright closed 11 months ago
Thanks for the report. All the issues but the last ones look more like setup issues which can be solved by setting your PATH to find the right tools first, or by specifying Makefile variables when launching make to accomodate for darwin specific issues. So let's keep this issue for the last item. Unfortunately it will likely require someone with access to mac M1 and gnat llvm to investigate, which isn't the case for the GNAT LLVM main developers. You might want to look at the generated LLVM bit code as well as the generate assembly. However it looks like potentially a pure LLVM issue, in which case, outside the scope of GNAT LLVM.
This is on an M1 Mac running GCC 13.1.0 built for aarch64-apple-darwin and Homebrew (llvm 16.0.6), with GCC sources at commit 92f2ec4 of Wed Aug 23 11:25:20 2023 +0800 and GNAT-LLVM at f97227c of 22 Aug 2023.
The problems are probably (my opinion) just Mac ones, not related to the machine architecture.
The first problem is that the compilation of
llvm_wrapper.cc
fails:Looking at Options Controlling C++ Dialect, under
--stdlib=libstdc++,libc++
it says "When G++ is configured to support this option ..." -- can you say how? (GNAT CE 2020 doesn't support it).I worked round this by
which gave rise to this
but otherwise seemed OK.
The second problem is that the link of
llvm-gnat1
failed with a lot of missing symbols, startingtraceable to the remarks here,
You also need to actually say
-lc++
! so, this patch:works (I also tried with just
LDFLAGS += -lc++
, builds OK; uses the system libc++ rather than Homebrew's).The fourth problem arose while building a program:
Worked round this problem by putting this in the GPR:
but now we get ..
.. the fifth problem, to do with ghost-only packages:
(this may be the Darwin linker being stricter than others, of course)
The zero-length objects are
Sorry for the multiple issues in one report, I thought that raising separate issues might be unhelpful.