I'm trying to build a arm-elf-gcc cross compiler.
So firts I installed binutils 2.18 with the following configure options:
./configure --target=arm-elf --enable-interwork --enable-multilib
This seems to work fine.
next I installed gmp, mpfr and libmpc
so now to the gcc itself.
//edit - removed previous error and updated with the current one (I tried to build everything separately)
First I install a bootstrap gcc with these configure options:
--target=arm-elf --disable-libssp --with-newlib --without-headers --with-gnu-as --with-gnu-ld
And afterwards I try to build newlib 1.17.0 with it
--target=arm-elf --disable-werror --disable-newlib-supplied-syscalls --disable-nls --with-gnu-as --with-gnu-ld
But this still results in the same error. Maybe newlib tries to build for x86 architecture with the apple gcc (I'm running these things all on OS X) which maybe doesn't understand these parameters?
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/dummy.c:1: error: bad value (core2) for -march= switch
cc1: error: unrecognized command line option "-msse4"
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
../../../../../../newlib/libc/argz/argz_add.c:1: error: bad value (core2) for -march= switch
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_add_sep.c:1: error: bad value (core2) for -march= switch
cc1: error: unrecognized command line option "-msse4"
make[8]: *** [lib_a-argz_add.o] Error 1
make[8]: *** Waiting for unfinished jobs....
../../../../../../newlib/libc/argz/argz_append.c:1: error: bad value (core2) for -march= switch
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_create.c:1: error: bad value (core2) for -march= switch
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_count.c:1: error: bad value (core2) for -march= switch
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_delete.c:1: error: bad value (core2) for -march= switch
make[8]: *** [lib_a-dummy.o] Error 1
make[8]: *** [lib_a-argz_create.o] Error 1
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
make[8]: *** [lib_a-argz_add_sep.o] Error 1
make[8]: *** [lib_a-argz_delete.o] Error 1
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
make[8]: *** [lib_a-argz_count.o] Error 1
make[8]: *** [lib_a-argz_append.o] Error 1
FATAL:/usr/bin/../libexec/gcc/darwin/x86_64/as: I don't understand 'm' flag!
cc1: error: unrecognized command line option "-msse4"
../../../../../../newlib/libc/argz/argz_create_sep.c:1: error: bad value (core2) for -march= switch
make[8]: *** [lib_a-argz_create_sep.o] Error 1
make[7]: *** [all-recursive] Error 1
make[6]: *** [all-recursive] Error 1
make[5]: *** [all] Error 2
make[4]: *** [multi-do] Error 1
make[3]: *** [all-multi] Error 2
make[2]: *** [all] Error 2
make[1]: *** [all-target-newlib] Error 2
make: *** [all] Error 2
Not every combination of binutils, gcc, and newlib work. I gave up a long time ago personally trying to find any combinations. Last time I was successful was in the gcc 3.x days, and you cant cross compile gcc 3.x with gcc 4.x or at least it is getting harder.
Maybe try without the interwork and multilib until you get straight arm working. Maybe you need an eabi in there in some form arm-non-eabi, something like that?
Here is a combination that gets a working gcc and libgcc
http://www.cowlark.com/2009-07-04-building-gcc/
code sourcery should have their build information available to figure out how to, at least get as far as binutils and gcc.
Somehow you are getting a core2 architecture in there, I dont see anything obvious though.
Yes this is an old post, but I found it as I was looking for an answer.
Now I found the answer, so I'll post it here.
Look closely at the "as" - which as is actually executed, your as for the host-computer or for the target architecture ?
The answer is: The as for the target architecture.
This happens when you build on Mac - both on PowerPC and on intel.
You should set up your PATH environment variable right after building binutils, so that the correct binutils will be found, otherwise your native x86 (or PowerPC) tools will be used to build your ARM target. That just won't work.
Related
If I verify my gcc --version I get:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
And when I build with make after configure, I obtain the following error:
ld: warning: ignoring file /usr/local/Cellar/gcc/11.3.0_2/lib/gcc/11/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: in '/usr/local/Cellar/gcc/11.3.0_2/lib/gcc/11/libquadmath.0.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
collect2: error: ld returned 1 exit status
make[8]: *** [libfgsl.la] Error 1
make[7]: *** [subdir-fgsl] Error 2
make[6]: *** [build-fgsl] Error 2
make[5]: *** [hd-std-all-subdirs] Error 2
make[4]: *** [all-subdirs] Error 2
make[3]: *** [hd-std-all] Error 2
make[2]: *** [all] Error 2
make[1]: *** [heacore] Error 2
make: *** [all] Error 2
Following the similar question here, I verified that
% ranlib --version
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: unknown option character `-' in: --version
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib [-sactfqLT] [-] archive [...]
(base) user#user BUILD_DIR % ranlib -version
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: unknown option character `v' in: -version
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib [-sactfqLT] [-] archive [...]
and that echo $PATH returns:
% echo $PATH
/usr/bin:/Users/username/opt/anaconda3/bin:/Users/username/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin
I have followed similar questions and a) updated Cmake, b) attempted to edit CMAKE_OSX_ARCHITECTURES (but not found in cmake), and more.
Why is this happening and how to fix it?
EDIT: for env:
% env
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/zsh
TERM=xterm-256color
TMPDIR=/var/folders/9x/gdg5j9sd4wx3q_v9f2pkrw6r0000gn/T/
TERM_PROGRAM_VERSION=445
TERM_SESSION_ID=C5417ED9-E4C8-411C-9CC3-18711A679E88
USER=username
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.nCSXSuYzna/Listeners
PATH=/usr/bin:/Users/username/opt/anaconda3/bin:/Users/username/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin
Im trying to compile Qt 5.9.x on my Mac OS High Sierra computer.
I configure with the following options:
./configure --prefix=/Users/myuserid/opt/qt593 \
-opensource \
-release -gui -widgets -no-opengl -confirm-license \
-shared -no-dbus -nomake examples
After configuring I compile and after a while it stops with the
following undefined symbols:
Undefined symbols for architecture x86_64:
"AVFVideoRendererControl::staticMetaObject", referenced from:
AVFMediaPlayerService::releaseControl(QMediaControl*) in avfmediaplayerservice.o
"AVFVideoRendererControl::AVFVideoRendererControl(QObject*)", referenced from:
AVFMediaPlayerService::requestControl(char const*) in avfmediaplayerservice.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [../../../../plugins/mediaservice/libqavfmediaplayer.dylib] Error 1
make[4]: *** [sub-mediaplayer-make_first] Error 2
make[3]: *** [sub-avfoundation-make_first] Error 2
make[2]: *** [sub-plugins-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qtmultimedia-make_first] Error 2
How do I fix or get past this error? I haven't seen an AVMediaPlayer package to download for Mac OS? I really don't need it anyhow since
Im not planning on doing any Sound or Video?
Anyone see this error and know how to fix it?
Thanks
I'm currently compiling Qt 5.9.3 on osx. I get the same error when I use the '--no-opengl' switch, without it, the compilation is successful. I don't know if this is an option for you, though.
I try to compile and build this code in my Mac OS. I try this following cmd.
cd ideviceactivate
make
sudo make install
In terminal when I tried with make it gets following error.
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [all] Error 1
make: *** [all] Error 2
Can you please guide me how to solve this issue.
Thanks
I am trying to install a debugger called Valgrind on OSX 10.11.2.
While running make, I get the following error
Undefined symbols for architecture i386:
"___ctzdi2", referenced from:
_doRegisterAllocation in libvex-x86-darwin.a(libvex_x86_darwin_a-host_generic_reg_alloc2.o)
ld: symbol(s) not found for architecture i386
make[3]: *** [memcheck-x86-darwin] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Do you know how to fix this?
This may or may not work for you, as I am operating in the following environment:
OS X 10.11.2,
Xcode 7.3.1
Custom built GCC 6.2.0 from source (which I am using instead of Xcode's clang compiler)
The following patch file applied to valgrind-3.12.0:
https://gist.github.com/milljm/22e40e723fb9faf201b83197fc23b4a1
I received the same error as OP, until I used the following extra configure argument:
./configure --enable-only64bit
When trying to install Qt on OSX (10.11) via homebrew with the --universal option
brew install qt --universal
I get the following error:
clang: error: invalid Xarch argument: '-Xarch_i386 -framework', options requiring arguments are unsupported
clang: error: invalid Xarch argument: '-Xarch_i386 -framework', options requiring arguments are unsupported
make[4]: *** [../../../../plugins/phonon_backend/libphonon_qt7.dylib] Error 1
make[3]: *** [release] Error 2
make[2]: *** [sub-qt7-make_default] Error 2
make[1]: *** [sub-phonon-make_default] Error 2
make: *** [sub-plugins-make_default-ordered] Error 2
Any idea on how to fix that?