I'm seeing a factor of four slowdown in Clang compilation versus GCC. Any idea what causes this?
ebg#tsuki(250)$ time /usr/bin/cc -DHC4 -DSAFETY -DNOREDUCE -DNFAIR=3 -O2 -o files2 pan.c
real 2m3.073s
user 1m59.484s
sys 0m3.585s
ebg#tsuki(251)$ time /usr/local/gcc/bin/gcc -DHC4 -DSAFETY -DNOREDUCE -DNFAIR=3 -O2 -o files1 pan.c
real 0m28.310s
user 0m27.590s
sys 0m0.706s
ebg#tsuki(252)$ /usr/bin/cc -v
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix
ebg#tsuki(253)$ /usr/local/gcc/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc/libexec/gcc/x86_64-apple-darwin10.7.0/4.6.0/lto-wrapper
Target: x86_64-apple-darwin10.7.0
Configured with: ./configure --prefix=/usr/local/gcc --enable-languages='c c++' --enable-lto --with-gmp=/usr/local/gcc --with-mpfr=/usr/local/gcc --with-mpc=/usr/local/gcc
Thread model: posix
gcc version 4.6.0 (GCC)
When I had the same problem it was due to clang was build for debug mode and not for release mode.
Related
I'm trying to tailor compiler flags of clang-11 to the apple-m1 CPU, which clang-11 doesn't know about yet.
The output of /usr/bin/clang -E - -mcpu=apple-m1 -### on macOS outputs a command with flags like these in it: "-target-feature" "+zcz"
From that you can infer the following features of the CPU:
armv8.5a+fp-armv8+neon+crc+crypto+dotprod+fp16fml+ras+lse+rdm+rcpc+zcm+zcz+fullfp16+sm4+sha3+sha2+aes
However, out of these, +fp-armv8+neon+zcm+zcz+fullfp16 are not recognised to be valid by any clang compiler:
$ cc -march=armv8.5a+zcz test.c
clang-11: error: the clang compiler does not support '-march=armv8.5a+zcz'
How can I tell clang to optimise for those target flags?
I am trying to build LLVM compilers so that I can enable OpenMP on the Apple M1.
I am using the LLVM development tree, (since I saw some OpenMP runtime go into that for this recently).
I have ended up with this script to invoke cmake:
# Xcode, Ninja
BUILD_SYSTEM=Ninja
BUILD_TAG=Ninja
cmake ../llvm \
-G$BUILD_SYSTEM -B ${BUILD_TAG}_build \
-DCMAKE_OSX_ARCHITECTURES='arm64' \
-DCMAKE_C_COMPILER=`which clang` \
-DCMAKE_CXX_COMPILER=`which clang++` \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=1 \
-DCMAKE_INSTALL_PREFIX=$HOME/software/clang-12.0.0/arm64 \
-DLLVM_ENABLE_WERROR=FALSE \
-DLLVM_TARGETS_TO_BUILD='AArch64' \
-DLLVM_ENABLE_PROJECTS='clang;openmp,polly' \
-DLLVM_DEFAULT_TARGET_TRIPLE='aarch64-apple-darwin20.1.0'
The compilers used here are
$ /usr/bin/clang --version
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: arm64-apple-darwin20.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
ninja can then successfully build clang, clang++ and the OpenMp runtime and install them. (As simple, Arm64 images targeting Arms64)
$ file ~/software/clang-12.0.0/arm64/bin/clang
/Users/jcownie/software/clang-12.0.0/arm64/bin/clang: Mach-O 64-bit executable arm64
$ ~/software/clang-12.0.0/arm64/bin/clang --version
clang version 12.0.0 (https://github.com/llvm/llvm-project.git 879c15e890b4d25d28ea904e92497f091f796019)
Target: aarch64-apple-darwin20.1.0
Thread model: posix
InstalledDir: /Users/jcownie/software/clang-12.0.0/arm64/bin
Which all looks sane, except that when I try to compile anything with them they are missing the include path to get system headers.
$ ~/software/clang-12.0.0/arm64/bin/clang hello.c
hello.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
So, after all that,
Does anyone know how to fix that include path problem?
Does anyone know how to configure and build a fat binary for the compilers (and libraries) so that the x86_64 embedded compiler targets x86_64 and the aarch64 binary aarch64? (This is what the Xcode clang and clang++ do...)
My attempt at this ended up with a compiler fat binary where both architectures targeted x86_64 :-(
Thanks
You can set -DDEFAULT_SYSROOT=/path/to/MacOSX11.1.sdk at build time or do export SDKROOT=/path/to/MacOSX11.1.sdk at runtime.
You need to compile with clang -arch arm64 -arch x86_64 to get a fat binary out of clang. You need to do this for Apple clang as well.
UPDATED 8 Feb 2021
Homebrew now supports the M1 based Arm machines, so using that is a better answer than the one below.
The info below is potentially still useful if you want to do this on your own, but using brew is likely to be much simpler.
Pre-brew answer
I haven't found a clean solution, but in case it helps anyone else, I do have a horrible hack.
The full recipe, then is configure with this script, then build and install.
# Xcode, Ninja
BUILD_SYSTEM=Ninja
BUILD_TAG=ninja
INSTALLDIR=$HOME/software/clang-12.0.0/arm64
cmake ../llvm \
-G$BUILD_SYSTEM -B ${BUILD_TAG}_build \
-DCMAKE_OSX_ARCHITECTURES='arm64' \
-DCMAKE_C_COMPILER=`which clang` \
-DCMAKE_CXX_COMPILER=`which clang++` \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
-DLLVM_LOCAL_RPATH=$INSTALLDIR/lib \
-DLLVM_ENABLE_WERROR=FALSE \
-DLLVM_TARGETS_TO_BUILD='AArch64' \
-DLLVM_DEFAULT_TARGET_TRIPLE='aarch64-apple-darwin20.1.0' \
-DDEFAULT_SYSROOT="$(xcrun --show-sdk-path)" \
-DLLVM_ENABLE_PROJECTS='clang;openmp;polly;clang-tools-extra;libcxx;libcxxabi' \
# -DLLVM_ENABLE_PROJECTS='clang;openmp;polly'
That gives a compiler that finds the right headers, but won't link successfully if OpenMP is used because it doesn't pass on any useful -L path or add a necessary rpath.
To overcome that I created a small shell script that sits in my ~/bin, at the front of my $PATH, which adds those extra linker flags.
#
# A truly awful hack, but it seems necessary.
# Install this with execute permissions as clang and clang++ in
# a directory early in your path, so that it is executed when clang or
# clang++ is needed.
#
# For brew...
INSTALLDIR=/usr/local/opt/llvm
# For a local build.
INSTALLDIR=${HOME}/software/clang-12.0.0/arm64/
# Find out the name of this file, and then invoke the same file in the
# compiler installation, adding the necessary linker directives
CMD=`echo $0 | sed "s/\/.*\///"`
${INSTALLDIR}/bin/${CMD} -L${INSTALLDIR}/lib -Wl,-rpath,${INSTALLDIR}/lib $*
I am not recommending this particularly; there should clearly be a better way to make it work, but it'll do for now, and lets me get back to using the compiler rather than building it!
I was able to build with -DDEFAULT_SYSROOT="$(xcrun --show-sdk-path)" -DCMAKE_INSTALL_PREFIX=/Users/foo/lokal/ and install into the lokal/bin lokal/lib path. Once that is done you can use LD_LIBRARY_PATH=/Users/foo/lokal/lib and all the libraries should be found without mucking with anything else rpath related.
I would like to have complete Win32 development toolchain without Microsoft SDKs. mingw64 works, but its linker is very slow. As an alternative, I am trying to use clang for windows. I can get clang 7.0.1 (but not 8.0.0) work with mingw headers/libraries, however only using mingw's ld.exe. If I force ldd.exe to be used (-fuse-ld=lld), everything compiles and links fine, but the application immediately crashes when started. Is there anything I can do here, like change something in the commandline?
This is how commandline and --verbose for the link step looks like:
Linking...
clang++ -static -o "C:\upp\out\MyApps\CLANG.Debug.Debug_Full\main.exe"
-ggdb -L"C:\upp\bin/mingw64/64/x86_64-w64-mingw32/lib"
-L"C:\uppbin/mingw64/64/opt/lib" -L"C:\upp\bin/SDL2/lib/x64"
-L"C:\upp\bin/pgsql/x64/bin"
-L"C:\upp\bin/mysql/lib64"
-Wl,--stack,20000000 --verbose -target x86_64-pc-windows-gnu
-fuse-ld=lld
"C:/upp/out/MyApps/main/CLANG.Debug.Debug_Full.Main\main.o"
-Wl,--start-group -Wl,--end-group
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-pc-windows-gnu
Thread model: posix
InstalledDir: C:\xxx\LLVM2\bin
"C:\\xxx\\LLVM2\\bin\\ld.lld" -m i386pep -Bstatic
-o "C:\\upp\\out\\MyApps\\CLANG.Debug.Debug_Full\\main.exe"
"C:\\upp\\bin\\mingw64\\64\\x86_64-w64-mingw32\\lib\\crt2.o"
"C:\\upp\\bin\\mingw64\\64\\lib\\gcc\\x86_64-w64-mingw32\\8.1.0\\crtbegin.o"
"-LC:\\upp\\bin/mingw64/64/x86_64-w64-mingw32/lib"
"-LC:\\upp\\bin/mingw64/64/opt/lib"
"-LC:\\upp\\bin/SDL2/lib/x64" "-LC:\\upp\\bin/pgsql/x64/bin"
"-LC:\\upp\\bin/mysql/lib64"
"-LC:\\upp\\bin\\mingw64\\64\\lib\\gcc\\x86_64-w64-mingw32\\8.1.0"
"-LC:\\upp\\bin\\mingw64\\64\\x86_64-w64-mingw32\\lib"
"-LC:\\upp\\bin\\mingw64\\64\\lib"
"-LC:\\upp\\bin\\mingw64\\64\\x86_64-w64-mingw32/sys-root/mingw/lib"
--stack 20000000
"C:/upp/out/MyApps/main/CLANG.Debug.Debug_Full.Main\\main.o"
--start-group --end-group -lstdc++ --start-group -lmingw32
-lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32
-luser32 -lkernel32 --end-group
"C:\\upp\\bin\\mingw64\\64\\lib\\gcc\\x86_64-w64-mingw32\\8.1.0\\crtend.o"
The llvm-mingw toolchain is very easy to use and provides latest clang / libc++ / lld without any dependency on the Microsoft headers: https://github.com/mstorsjo/llvm-mingw
It links against the Microsoft ucrt and as such is compatible with MSVC-built DLLs (for the C API / ABI, not the C++ since it uses a different standard library implementation)
My program uses the documented autoconf macro AM_PROG_LEX. It builds fine on RHEL 6.5 and other distros, but fails on RHEL 6.6 and later.
The configure script cannot compile its tests. When it tries gcc with -ll, -lfl, linking fails with:
/usr/bin/ld: cannot find -lfl
When it tries gcc without extra libraries, linking fails with:
undefined reference to `yywrap'
libfl.a or libfl.so is missing from official repos of those systems. On RHEL 6.5 it's part of flex package.
RHEL 6.5
configure:5334: checking whether yytext is a pointer
configure:5351: gcc -o conftest -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O0 conftest.c -lfl >&5
configure:5351: $? = 0
configure:5359: result: yes
RHEL 6.8
configure:5196: checking whether yytext is a pointer
configure:5217: gcc -o conftest -g -O2 conftest.c >&5
/tmp/ccNJtVgv.o: In function `input':
/home/git/rpmbuild/BUILD/snacc-1.3.1_16_g23ba7a6/lex.yy.c:1168: undefined reference to `yywrap'
/tmp/ccNJtVgv.o: In function `yylex':
/home/git/rpmbuild/BUILD/snacc-1.3.1_16_g23ba7a6/lex.yy.c:867: undefined reference to `yywrap'
/tmp/ccNJtVgv.o: In function `main':
/home/git/rpmbuild/BUILD/snacc-1.3.1_16_g23ba7a6/conftest.l:17: undefined reference to `yywrap'
collect2: ld returned 1 exit status
configure:5224: $? = 1
configure: failed program was:
...
configure:5246: result: no
libfl contains two and only two functions, both of which are normally unnecessary in production use of flex:
int main() { extern int yylex(void); while (yylex()) ; return 0; }
int yywrap(void) { return 1; }
The yywrap implementation (which essentially disables the yywrap functionality) is not necessary if you use the option
%option noyywrap
in your flex definition, or if you pass the command-line option --noyywrap to flex.
For quick-and-dirty flex scanners, or for debugging, it is sometimes handy to be able to use libfl to fill in the above functions. But it also can create problems on systems which provide both 32- and 64-bit environments. For this reason, libfl was removed from the RHEL flex rpm in 2014. See this RedHat bug fix advisory for details.
So you could install the appropriate flex-devel rpm in order to have libfl available. Or you could compile it yourself using the above code (which is not precisely the source code you'll find in the flex source bundle, but should produce precisely the same library).
Or you could try to fix autoconf so that it doesn't depend on libfl. It didn't used to have any such dependency; if it couldn't find libfl, it would just assume that it wasn't required for the program being compiled.
Workaround is to install flex-devel package containing libfl.a. RHEL version available to subscribers ony. Alternative is CentOS package or recompiling from source.
tl;dr
How can I compile Ada source code to a static library file suitable for apps on iPad targets running iOS to link against? (GCC is not a requirement. Solutions using LLVM or others are also welcome!)
I have a large library of portable Ada code that I would like to use in an iPad/iOS project. My host OS is Mac OS X 10.9 (running GCC 4.8.1 installed at /opt/local with MacPorts). To do this, I'm trying to build a GCC ARM cross-compiler with Ada support.
I am able to build a working GCC and GNAT that creates ARM executables, but I can't seem to build or install the Ada standard library, which is required for building my Ada code
The source packages I'm using:
gcc-4.8.1
binutils-2.24
libiconv-1.14
gmp-5.1.3
mpc-1.0.2
mpfr-3.1.2
The GCC build configuration:
$ bin/arm-none-eabi-gcc -v --version
Using built-in specs.
COLLECT_GCC=bin/arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/Users/ardnew/cross/libexec/gcc/arm-none-eabi/4.8.1/lto-wrapper
arm-none-eabi-gcc (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Target: arm-none-eabi
Configured with: /Users/ardnew/cross/src/gcc-4.8.1/configure --target=arm-none-eabi --prefix=/Users/ardnew/cross --with-cpu=cortex-a8 --enable-languages=c,ada --disable-multilib --enable-interwork --disable-threads --disable-shared --disable-nls --disable-lto --disable-libssp --disable-decimal-float --disable-libgomp --disable-libmudflap
Thread model: single
gcc version 4.8.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '--version' '-mcpu=cortex-a8'
/Users/ardnew/cross/libexec/gcc/arm-none-eabi/4.8.1/cc1 -quiet -v -D__USES_INITFINI__ help-dummy -quiet -dumpbase help-dummy -mcpu=cortex-a8 -auxbase help-dummy -version --version -o /var/folders/4c/y_sll7bj6b9bt15389wr66_80000gn/T//ccrSSKFx.s
GNU C (GCC) version 4.8.1 (arm-none-eabi)
compiled by GNU C version 4.8.1, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-v' '--version' '-mcpu=cortex-a8'
/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/as -mcpu=cortex-a8 -meabi=5 --version -o /var/folders/4c/y_sll7bj6b9bt15389wr66_80000gn/T//ccZYvQLp.o /var/folders/4c/y_sll7bj6b9bt15389wr66_80000gn/T//ccrSSKFx.s
GNU assembler (GNU Binutils) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `arm-none-eabi'.
COMPILER_PATH=/Users/ardnew/cross/libexec/gcc/arm-none-eabi/4.8.1/:/Users/ardnew/cross/libexec/gcc/arm-none-eabi/4.8.1/:/Users/ardnew/cross/libexec/gcc/arm-none-eabi/:/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/:/Users/ardnew/cross/lib/gcc/arm-none-eabi/:/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/
LIBRARY_PATH=/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/:/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-v' '--version' '-mcpu=cortex-a8'
/Users/ardnew/cross/libexec/gcc/arm-none-eabi/4.8.1/collect2 -X --version /Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/crti.o /Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/crtbegin.o crt0.o -L/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1 -L/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib /var/folders/4c/y_sll7bj6b9bt15389wr66_80000gn/T//ccZYvQLp.o --start-group -lgcc -lc --end-group /Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/crtend.o /Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/crtn.o
collect2 version 4.8.1
/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/ld -X --version /Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/crti.o /Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/crtbegin.o crt0.o -L/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1 -L/Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/lib /var/folders/4c/y_sll7bj6b9bt15389wr66_80000gn/T//ccZYvQLp.o --start-group -lgcc -lc --end-group /Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/crtend.o /Users/ardnew/cross/lib/gcc/arm-none-eabi/4.8.1/crtn.o
GNU ld (GNU Binutils) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
Test program to ensure its building ARM binaries:
$ cat told_unit1.adb told_unit1.ads
--
-- FILE: told_unit1.adb
--
with Ada.Text_IO;
use Ada.Text_IO;
package body told_unit1 is
procedure hello is
begin
put_line("hello, world");
end hello;
function double(x : in float) return float is
begin
return x + x;
end double;
end told_unit1;
--
-- FILE: told_unit1.ads
--
package told_unit1 is
procedure hello;
pragma Export
(
convention => C,
entity => hello,
external_name => "ada_hello"
);
function double(x : in float) return float;
pragma Export
(
convention => C,
entity => double,
external_name => "ada_double"
);
end told_unit1;
Then compiling the Ada code and inspecting it with file:
$ arm-none-eabi-gcc -c told_unit1.adb
$ file told_unit1.o
told_unit1.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
And then when I try to bind the library object file it pukes:
$ arm-none-eabi-gnatbind -aO$ADA_OBJECT_PATH -Ltold told_unit1
error: "a-textio.ali" not found, "a-textio.adb" must be compiled
Going back to my GCC build logs, I found that libada (which I believe is part of GNAT) wasn't ever built. When I try to run make all-target-libada from the GCC build directory, it eventually tells me:
Configuring in arm-none-eabi/libada
configure: loading cache ./config.cache
checking build system type... x86_64-apple-darwin13.1.0
checking host system type... arm-none-eabi
checking target system type... arm-none-eabi
checking for arm-none-eabi-gcc... /Users/ardnew/cross/src/gcc-4.8.1-obj/./gcc/xgcc -B/Users/ardnew/cross/src/gcc-4.8.1-obj/./gcc/ -B/Users/ardnew/cross/arm-none-eabi/bin/ -B/Users/ardnew/cross/arm-none-eabi/lib/ -isystem /Users/ardnew/cross/arm-none-eabi/include -isystem /Users/ardnew/cross/arm-none-eabi/sys-include
checking for C compiler default output file name...
configure: error: in `/Users/ardnew/cross/src/gcc-4.8.1-obj/arm-none-eabi/libada':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** [configure-target-libada] Error 1
And so I go inspect that config.log its referring to and find the following:
configure:2351: $? = 0
configure:2340: /Users/ardnew/cross/src/gcc-4.8.1-obj/./gcc/xgcc -B/Users/ardnew/cross/src/gcc-4.8.1-obj/./gcc/ -B/Users/ardnew/cross/arm-none-eabi/bin/ -B/Users/ardnew/cross/arm-none-eabi/lib/ -isystem /Users/ardnew/cross/arm-none-eabi/include -isystem /Users/ardnew/cross/arm-none-eabi/sys-include -v >&5
COLLECT_LTO_WRAPPER=/Users/ardnew/cross/src/gcc-4.8.1-obj/./gcc/lto-wrapper
Target: arm-none-eabi
Configured with: /Users/ardnew/cross/src/gcc-4.8.1/configure --target=arm-none-eabi --prefix=/Users/ardnew/cross --with-cpu=cortex-a8 --enable-languages=c,ada --disable-multilib --enable-interwork --disable-threads --disable-shared --disable-nls --disable-lto --disable-libssp --disable-decimal-float --disable-libgomp --disable-libmudflap
configure:2351: $? = 0
xgcc: error: unrecognized command line option '-qversion'
xgcc: fatal error: no input files
compilation terminated.
configure:2351: $? = 1
configure:2371: checking for C compiler default output file name
configure:2393: /Users/ardnew/cross/src/gcc-4.8.1-obj/./gcc/xgcc -B/Users/ardnew/cross/src/gcc-4.8.1-obj/./gcc/ -B/Users/ardnew/cross/arm-none-eabi/bin/ -B/Users/ardnew/cross/arm-none-eabi/lib/ -isystem /Users/ardnew/cross/arm-none-eabi/include -isystem /Users/ardnew/cross/arm-none-eabi/sys-include -g -O2 conftest.c >&5
/Users/ardnew/cross/arm-none-eabi/bin/ld: cannot find crt0.o: No such file or directory
/Users/ardnew/cross/arm-none-eabi/bin/ld: cannot find -lg
/Users/ardnew/cross/arm-none-eabi/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
configure:2397: $? = 1
configure:2434: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2440: error: in `/Users/ardnew/cross/src/gcc-4.8.1-obj/arm-none-eabi/libada':
configure:2444: error: C compiler cannot create executables
See `config.log' for more details.
So at this point I'm way over my head and not really sure what to do next. It looks like I'm missing a C runtime library for ARM maybe?
Any help configuring GNAT/libada for ARM targets would be great.
Alternatively- is there a simpler way to link against Ada libraries from an Xcode iOS project?
Unfortunately, the answer is that there is no auto-magic tool to accomplish this. You can use tooling to validate the translations after the fact, but what you want isn't available yet.
I've had to deal with this same question in the past. A different answer would have dramatically changed one of my project's budgets, too. Perhaps someday.
Though I admit, I think there are ultimately enough incompatibilities that your source would need to be drastically altered - reducing the value of what you are looking to achieve here. In the end, the new investment is a bummer but will result in better source, if you can afford it.