Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-10

fpc compiler is unable to link on OSX Mavericks

7 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Ring

I today installed the GA of Mavericks, it seems that crt1.o was deleted from /usr/lib:

devel]$ fpc hello.pas
Free Pascal Compiler version 2.6.2 [2013/02/03] for i386 Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Darwin for i386
Compiling hello.pas
Assembling (pipe) hello.s
Linking hello
ld: file not found: /usr/lib/crt1.o
An error occurred while linking
hello.pas(4,1) Error: Error while linking
hello.pas(4,1) Fatal: There were 1 errors compiling module, stopping

crt1.o can now be found in the following places:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/crt1.o /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/crt1.o

Michael

Reply by email

Jonas Maebe
to Michael Ring
Michael Ring wrote 21 lines
I today installed the GA of Mavericks, it seems that crt1.o was deleted from /usr/lib: devel]$ fpc hello.pas Free Pascal Compiler version 2.6.2 [2013/02/03] for i386 Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Darwin for i386 Compiling hello.pas Assembling (pipe) hello.s Linking hello ld: file not found: /usr/lib/crt1.o An error occurred while linking hello.pas(4,1) Error: Error while linking hello.pas(4,1) Fatal: There were 1 errors compiling module, stopping crt1.o can now be found in the following places: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ Developer/SDKs/MacOSX10.8.sdk/usr/lib/crt1.o /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ Developer/SDKs/MacOSX10.9.sdk/usr/lib/crt1.o

If this is the case even after *re*installing the command line tools in case you upgraded (which I assume you did, otherwise you'd presumably get other errors), then you will have to explicitly specify a location of an SDK via -XR/Applications/Xcode.app/Contents/Developer/ Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk or / Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ Developer/SDKs/MacOSX10.9.sdk

Jonas

Reply by email

Jonas Maebe
to Jonas Maebe
Jonas Maebe wrote 16 lines
On 04 Oct 2013, at 13:03, Michael Ring wrote: > crt1.o can now be found in the following places: > > /Applications/Xcode.app/Contents/Developer/Platforms/ > MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/crt1.o > /Applications/Xcode.app/Contents/Developer/Platforms/ > MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/crt1.o If this is the case even after *re*installing the command line tools in case you upgraded (which I assume you did, otherwise you'd presumably get other errors), then you will have to explicitly specify a location of an SDK via -XR/Applications/Xcode.app/Contents/ Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk or /Applications/Xcode.app/Contents/Developer/Platforms/ MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk

BTW can you post the output of the following command: clang -print-search-dirs

Jonas

Reply by email

Michael Ring
to Jonas Maebe: If this is the case even after *re*installing the command line tools in case you upgraded…

XR does the trick... I will check later today if the installation of the fpc packages still works out of the box or if the missing crt1.o will cause a problem for new users.

on commandline-tools:
the funny thing is that XCode (5.01 GA) does not show command line package tools package in 'Downloads' anymore on my system, not sure if this is because I updated my system or because they changed the way that the commandline tools are installed.

Michael

devel]$ fpc hello.pas
-XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk Free Pascal Compiler version 2.6.2 [2013/02/03] for i386 Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Darwin for i386
Compiling hello.pas
Assembling (pipe) hello.s
Linking hello
4 lines compiled, 0.1 sec

devel]$ clang -print-search-dirs
programs:
=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin libraries:
=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0

devel]$ ls -l
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/lib/darwin total 272
-rw-r--r--@ 1 ring admin 7832 Sep 26 22:09 libclang_rt.10.4.a -rw-r--r--@ 1 ring admin 263596 Sep 26 22:09 libclang_rt.cc_kext.a -rw-r--r--@ 1 ring admin 123532 Sep 26 22:09 libclang_rt.cc_kext_ios5.a -rw-r--r--@ 1 ring admin 1824 Sep 24 04:34 libclang_rt.eprintf.a -rw-r--r--@ 1 ring admin 20484 Sep 26 22:09 libclang_rt.ios.a -rw-r--r--@ 1 ring admin 5968 Sep 24 04:34 libclang_rt.osx.a -rw-r--r--@ 1 ring admin 54564 Sep 26 22:09 libclang_rt.profile_ios.a -rw-r--r--@ 1 ring admin 25504 Sep 26 22:09 libclang_rt.profile_osx.a

Jonas Maebe wrote 39 lines
On 04 Oct 2013, at 13:03, Michael Ring wrote: > I today installed the GA of Mavericks, it seems that crt1.o was > deleted from /usr/lib: > > devel]$ fpc hello.pas > Free Pascal Compiler version 2.6.2 [2013/02/03] for i386 > Copyright (c) 1993-2012 by Florian Klaempfl and others > Target OS: Darwin for i386 > Compiling hello.pas > Assembling (pipe) hello.s > Linking hello > ld: file not found: /usr/lib/crt1.o > An error occurred while linking > hello.pas(4,1) Error: Error while linking > hello.pas(4,1) Fatal: There were 1 errors compiling module, stopping > > crt1.o can now be found in the following places: > > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/crt1.o > > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/crt1.o > If this is the case even after *re*installing the command line tools in case you upgraded (which I assume you did, otherwise you'd presumably get other errors), then you will have to explicitly specify a location of an SDK via -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk or /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk Jonas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Jonas Maebe
to Michael Ring
Michael Ring wrote 5 lines
on commandline-tools: the funny thing is that XCode (5.01 GA) does not show command line package tools package in 'Downloads' anymore on my system, not sure if this is because I updated my system or because they changed the way that the commandline tools are installed.

Apparently they are now a separate download, which should be installed automatically the first time you try to use one of the command line tools: http://stackoverflow.com/questions/17066849/command-line-tools-for-new-10-9-osx-for-ruby-gems

If you did not get a pop-up as described in that thread, maybe you are using some kind of partial install of the command line tools. Can you try downloading them separately and installing them, to verify that there is still no globally installed crt1.o afterwards?

Show quoted text 6 lines
devel]$ clang -print-search-dirs programs: =/Applications/Xcode.app/Contents/Developer/Toolchains/ XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/ Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin libraries: =/Applications/Xcode.app/Contents/Developer/Toolchains/ XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0

It's rather strange that this doesn't include any directory containing crt1.o, unless clang automatically searches other directories relative to that library directory. Can you check your environment variables (just type "set" in a terminal window) to see whether it contains any variables with a path to an SDK?

Jonas

Reply by email

Jonas Maebe
to Jonas Maebe
Jonas Maebe wrote
If you did not get a pop-up as described in that thread, maybe you are using some kind of partial install of the command line tools. Can you try downloading them separately and installing them,

Or just execute "xcode-select --install"

Jonas

Reply by email

Michael Ring
to Jonas Maebe

After

xcode-select --install

crt1.o is once again visible in /usr/lib.

No idea why Apple decided to go this strange way, thank you for your help!

Michael

Jonas Maebe wrote 16 lines
On 04 Oct 2013, at 14:38, Jonas Maebe wrote: > If you did not get a pop-up as described in that thread, maybe you > are using some kind of partial install of the command line tools. Can > you try downloading them separately and installing them, Or just execute "xcode-select --install" Jonas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email