Sign in Join

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

Mailing lists / fpc-pascal / 2015-01

OSX x86_64 make problem

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Anthony Walter

Hello free pascal compiler developers,

Problem: On OSX the x86_64-darwin compiler "ppcx64" is not being built.

Background: I am in the process of writing a series of installers/scripts for Free Pascal 3.0 and Lazarus 1.4 testing. I'm currently writing a unified OSX install script which automates installing up these items on a fresh copy of OSX.

Details: The problem I am having is that even on a 64bit Mac, the "make all" command builds i386-darwin. When I try to "make crossinstall OS_TARGET=darwin CPU_TARGET=x86_64
INSTALL_PREFIX=/Users/macuser/Development/Base/fpc" the make command returns success, but no ppcx64 is ever created.

When I write a simple test program such as below and compile with "fpc hello.pas", the output is 'SizeOf(Pointer) = 4'

program hello;
begin
  WriteLn('SizeOf(Pointer) = ', SizeOf(Pointer));
end.

When I compile with 'fpc -Px86_64 hello.pas' i get the error:

Fatal: Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode /bin/sh: x86_64-darwin-as: command
not found

Which tells fpc fell back to the 2.6.4 complier instead of my new 3.0.1 compiler because it couldn't find ppcx64 in my
'/Users/macuser/Development/Base/fpc/bin' folder. In fact, no ppcx64 is being is the out of my make crossinstall command: http://pastebin.com/yBJL4mQi

And when I type "find /Users/macuser/Development/Base/fpc name=ppcx64", no result is found.

Reply by email

Ewald
to Anthony Walter: Hello free pascal compiler developers, Problem: On OSX the x86_64-darwin compiler…
Anthony Walter wrote
Details: The problem I am having is that even on a 64bit Mac, the "make all" command builds i386-darwin. When I try to "make crossinstall OS_TARGET=darwin CPU_TARGET=x86_64 INSTALL_PREFIX=/Users/macuser/Development/Base/fpc"

Have you tried `make CPU_TARGET=x86_64 all` instead of `crossinstall`? That's how I just built the latest revision, 29488.

Just a suggestion...

Ewald

Reply by email

Michael Ring
to Ewald

Zhis is what I use on my Mac:

make clean all CPU_TARGET=x86_64 INSTALL_PREFIX=$HOME/3.0.1

Michael

Ewald wrote 10 lines
On 01/16/2015 10:08 PM, Anthony Walter wrote: > Details: The problem I am having is that even on a 64bit Mac, the > "make all" command builds i386-darwin. When I try to "make > crossinstall OS_TARGET=darwin CPU_TARGET=x86_64 > INSTALL_PREFIX=/Users/macuser/Development/Base/fpc" Have you tried `make CPU_TARGET=x86_64 all` instead of `crossinstall`? That's how I just built the latest revision, 29488. Just a suggestion...

Reply by email

Jonas Maebe
to Anthony Walter: Hello free pascal compiler developers, Problem: On OSX the x86_64-darwin compiler…
Anthony Walter wrote 6 lines
Details: The problem I am having is that even on a 64bit Mac, the "make all" command builds i386-darwin. When I try to "make crossinstall OS_TARGET=darwin CPU_TARGET=x86_64 INSTALL_PREFIX=/Users/macuser/Development/Base/fpc" the make command returns success, but no ppcx64 is ever created.

It will install a file called ppcrossx64. My own build script renames it to ppcx64 after "make install" (and before building the installer package). The reason the default is ppcrossx64, is because otherwise inside the compiler dir the built native compiler would overwrite the built cross-compiler, and installing both into the same prefix would not be possible either.

However, there is no reason on Darwin to use different name for native and for cross-compilers (you can combine both into a fat binary, if you absolutely want two versions), and always using the same name makes it easier for scripts to call the compiler using a fixed name.

Show quoted text 8 lines
When I compile with 'fpc -Px86_64 hello.pas' i get the error: Fatal: Compilation aborted Error: /usr/local/bin/ppcx64 returned an error exitcode /bin/sh: x86_64-darwin-as: command not found Which tells fpc fell back to the 2.6.4 complier

That error says that some program cannot find a cross-assembler, which is a message emitted by a compiler binary (not by the "fpc" utility). That message is not specific to either FPC 2.6.4 or to 3.x.

It suggests that the compiler is not using the default /etc/fpc.cfg configuration file, or an otherwise custom fpc.cfg file that does not contain the necessary ifdefs to prevents a cross-compiling prefix from being added to the assembler and linker when targeting Darwin (any architecture) from a Darwin (any architecture) system.

Jonas

Reply by email

Michael Ring
to Sven Barth

I usually build as unprivilidged user, installation is then

sudo make install CPU_TARGET=x86_64 INSTALL_PREFIX=$SOMEWHERE

you are right, in the situation where I do use my own $HOME for the compiler (so Installation also hapens in my context) this would have been the complete solution:

make clean all install CPU_TARGET=x86_64 INSTALL_PREFIX=$HOME/3.0.1

Michael

Sven Barth wrote 19 lines
Am 16.01.2015 23:14 schrieb "Michael Ring" < >: > > Zhis is what I use on my Mac: > > make clean all CPU_TARGET=x86_64 INSTALL_PREFIX=$HOME/3.0.1 Don't you miss an "install" in that line? Afterall "all" merely builds the compiler (plus RTL plus packages), but does not install it... Regards, Sven _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email