OSX x86_64 make problem

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

OSX x86_64 make problem

Anthony Walter-3
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
macuser@macpc~/Development/Base/test$ /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 generated at all.

Here is the out of my make crossinstall command:

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




_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: OSX x86_64 make problem

Anthony Walter-3
I forgot to mention, I am using fpc sources from the fixes_3_0 branch, and building using fpc 2.6.4.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: OSX x86_64 make problem

Ewald-2
In reply to this post by Anthony Walter-3
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...

--

Ewald


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: OSX x86_64 make problem

Michael Ring-2
Zhis is what I use on my Mac:

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

Michael

Am 16.01.15 um 22:23 schrieb Ewald:

> 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...
>

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: OSX x86_64 make problem

Jonas Maebe-2
In reply to this post by Anthony Walter-3
On 16/01/15 22:08, 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" 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.

> 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
> macuser@macpc~/Development/Base/test$ /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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: OSX x86_64 make problem

Sven Barth-2
In reply to this post by Michael Ring-2

Am 16.01.2015 23:14 schrieb "Michael Ring" <[hidden email]>:
>
> 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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: OSX x86_64 make problem

Michael Ring-2
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

Am 17.01.15 um 09:40 schrieb Sven Barth:

Am 16.01.2015 23:14 schrieb "Michael Ring" <[hidden email]>:
>
> 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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal