Sign in Join

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

Mailing lists / fpc-devel / 2013-11

Problems with building x86_64 on darwin

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Andrew Brunner

I've got darwin Mac OS 10.9 running fpc 2.6.2 installed and compiling from the downloads section of the site.
I'm trying with no success to get 2.7.1 to compile ppcx64 with /usr/local/bin/fpc ->/usr/local/lib/fpc/2.6.2/ppcx64

which fpc shows...
/usr/local/bin/fpc

contents of /usr/local/bin/ include...
lrwxr-xr-x 1 root wheel 31 Nov 25 14:06 fpc -> /usr/local/lib/fpc/2.6.2/ppcx64
lrwxr-xr-x 1 root wheel 31 Nov 25 08:28 pp386 -> /usr/local/lib/fpc/2.6.2/ppc386
lrwxr-xr-x 1 root wheel 31 Nov 25 14:06 ppc386 -> /usr/local/lib/fpc/2.6.2/ppc386
lrwxr-xr-x 1 root wheel 31 Nov 25 14:06 ppcx64 -> /usr/local/lib/fpc/2.6.2/ppcx64

The line in my install script that creates the fpc.cfg sudo /usr/local/lib/fpc/2.6.2/samplecfg /usr/local/lib/fpc/2.6.2 /etc

The /etc/fpc.cfg looks good with the exception of a missing lib folder -Fl/usr/local/lib/fpc/$fpcversion/lib/$FPCTARGET

There is no /usr/local/lib/fpc/2.6.2/lib folder

--------- FPC BUILD PROBLEMS------------
Trying to build my svn/fpc/trunk version

make all OPT="-O-" DEBUG=1 OS_TARGET=darwin CPU_TARGET=x86_64 PP=/usr/local/lib/fpc/2.6.2/ppcx64

/usr/local/lib/fpc/2.6.2/ppcx64 -dNOMOUSE -Ur -dFPC_USE_LIBC -gl -Ur -Xs -O2 -n -Fi../inc -Fi../i386 -Fi../unix -Fi../bsd -Fi../bsd/i386 -Fi../darwin/i386 -FE. -FU/Developer/FPC/rtl/units/i386-darwin -O- -di386 -dDEBUG -dRELEASE -Us -Sg ../bsd/system.pp
system.inc(171,4) Fatal: Can't open include file "x86_64.inc" Fatal: Compilation aborted
make[5]: *** [system.ppu]

------------Lazarus Build Problems------------
Trying to build my svn/lazarus/trunk verison

Much compiles but linking fails towards the end with error:

Compiling resource ../units/x86_64-darwin/nogui/lazbuild.or Linking ../lazbuild
Undefined symbols for architecture x86_64:
"_LSOpenCFURLRef", referenced from:
_LCLINTF_OPENURL$ANSISTRING$$BOOLEAN in lclintf.o
ld: symbol(s) not found for architecture x86_64
An error occurred while linking
lazbuild.lpr(1629) Error: Error while linking
lazbuild.lpr(1629) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[2]: *** [lazbuild] Error 1
make[1]: *** [lazbuilder] Error 2
make: *** [lazbuild] Error 2

Any thoughts would be greatly appreciated.

Reply by email

Jonas Maebe
to Andrew Brunner
Andrew Brunner wrote
I've got darwin Mac OS 10.9 running fpc 2.6.2 installed and compiling from the downloads section of the site. I'm trying with no success to get 2.7.1 to compile ppcx64 with /usr/local/bin/fpc ->/usr/local/lib/fpc/2.6.2/ppcx64

First of all, reinstall FPC so that /usr/local/bin/fpc is valid again. "fpc" is an independent program and can never be a symbolic link to a compiler binary. It supports parameters that the compiler binaries do not support. You cannot overwrite it with a symbolic link.

Show quoted text 11 lines
--------- FPC BUILD PROBLEMS------------ Trying to build my svn/fpc/trunk version make all OPT="-O-" DEBUG=1 OS_TARGET=darwin CPU_TARGET=x86_64 PP=/usr/local/lib/fpc/2.6.2/ppcx64 /usr/local/lib/fpc/2.6.2/ppcx64 -dNOMOUSE -Ur -dFPC_USE_LIBC -gl -Ur -Xs -O2 -n -Fi../inc -Fi../i386 -Fi../unix -Fi../bsd -Fi../bsd/i386 -Fi../darwin/i386 -FE. -FU/Developer/FPC/rtl/units/i386-darwin -O- -di386 -dDEBUG -dRELEASE -Us -Sg ../bsd/system.pp system.inc(171,4) Fatal: Can't open include file "x86_64.inc" Fatal: Compilation aborted make[5]: *** [system.ppu] ------------Lazarus Build Problems------------

That's because ppcx64 on Mac OS X is an i386->x86-64 cross-compiler and the Makefiles are not designed for bootstrapping with cross-compilers. You can work around it by adding CPU_SOURCE=x86_64, but you can just as well build a new cross-compiler.

Show quoted text 19 lines
Trying to build my svn/lazarus/trunk verison Much compiles but linking fails towards the end with error: Compiling resource ../units/x86_64-darwin/nogui/lazbuild.or Linking ../lazbuild Undefined symbols for architecture x86_64: "_LSOpenCFURLRef", referenced from: _LCLINTF_OPENURL$ANSISTRING$$BOOLEAN in lclintf.o ld: symbol(s) not found for architecture x86_64 An error occurred while linking lazbuild.lpr(1629) Error: Error while linking lazbuild.lpr(1629) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[2]: *** [lazbuild] Error 1 make[1]: *** [lazbuilder] Error 2 make: *** [lazbuild] Error 2 Any thoughts would be greatly appreciated.

Lazarus cannot yet be compiled for x86-64 on Mac OS X (except if you compile it for GTK or Qt, possibly). Unless you are editing files that are larger than 1.5GB, it's unlikely you'd notice any difference either.

Jonas

Reply by email

Andrew Brunner
to Jonas Maebe
Jonas Maebe wrote 5 lines
On 25 Nov 2013, at 21:28, Andrew Brunner wrote: > I've got darwin Mac OS 10.9 running fpc 2.6.2 installed and compiling from the downloads section of the site. > I'm trying with no success to get 2.7.1 to compile ppcx64 with /usr/local/bin/fpc ->/usr/local/lib/fpc/2.6.2/ppcx64 First of all, reinstall FPC so that /usr/local/bin/fpc is valid again. "fpc" is an independent program and can never be a symbolic link to a compiler binary. It supports parameters that the compiler binaries do not support. You cannot overwrite it with a symbolic link.

I re-installed and it replaced the symlink with the fpc binary. I retried to build FPC with no luck. Same error as before.

Show quoted text 9 lines
> --------- FPC BUILD PROBLEMS------------ > Trying to build my svn/fpc/trunk version > > make all OPT="-O-" DEBUG=1 OS_TARGET=darwin CPU_TARGET=x86_64 PP=/usr/local/lib/fpc/2.6.2/ppcx64 > > /usr/local/lib/fpc/2.6.2/ppcx64 -dNOMOUSE -Ur -dFPC_USE_LIBC -gl -Ur -Xs -O2 -n -Fi../inc -Fi../i386 -Fi../unix -Fi../bsd -Fi../bsd/i386 -Fi../darwin/i386 -FE. -FU/Developer/FPC/rtl/units/i386-darwin -O- -di386 -dDEBUG -dRELEASE -Us -Sg ../bsd/system.pp > system.inc(171,4) Fatal: Can't open include file "x86_64.inc" > Fatal: Compilation aborted > make[5]: *** [system.ppu]

make all OPT="-O-" DEBUG=1 OS_TARGET=darwin CPU_TARGET=x86_64 PP=/usr/local/lib/fpc/2.6.2/ppc386 works perfectly. Why doesn't ppcx64 work at all?

> ------------Lazarus Build Problems------------ That's because ppcx64 on Mac OS X is an i386->x86-64 cross-compiler and the Makefiles are not designed for bootstrapping with cross-compilers. You can work around it by adding CPU_SOURCE=x86_64, but you can just as well build a new cross-compiler.

I just need something that works. It's a goal to have 64bit support for my downloads. I like to have a 64bit build of FPC like on Linux.

Lazarus cannot yet be compiled for x86-64 on Mac OS X (except if you compile it for GTK or Qt, possibly). Unless you are editing files that are larger than 1.5GB, it's unlikely you'd notice any difference either.

Ok. At least I know it's not supported yet.

Reply by email

Jonas Maebe
to Andrew Brunner
Andrew Brunner wrote 14 lines
On 11/25/13, 2:56 PM, Jonas Maebe wrote: > On 25 Nov 2013, at 21:28, Andrew Brunner wrote: > >> --------- FPC BUILD PROBLEMS------------ >> Trying to build my svn/fpc/trunk version >> >> make all OPT="-O-" DEBUG=1 OS_TARGET=darwin CPU_TARGET=x86_64 PP=/usr/local/lib/fpc/2.6.2/ppcx64 >> >> /usr/local/lib/fpc/2.6.2/ppcx64 -dNOMOUSE -Ur -dFPC_USE_LIBC -gl -Ur -Xs -O2 -n -Fi../inc -Fi../i386 -Fi../unix -Fi../bsd -Fi../bsd/i386 -Fi../darwin/i386 -FE. -FU/Developer/FPC/rtl/units/i386-darwin -O- -di386 -dDEBUG -dRELEASE -Us -Sg ../bsd/system.pp >> system.inc(171,4) Fatal: Can't open include file "x86_64.inc" >> Fatal: Compilation aborted >> make[5]: *** [system.ppu] make all OPT="-O-" DEBUG=1 OS_TARGET=darwin CPU_TARGET=x86_64 PP=/usr/local/lib/fpc/2.6.2/ppc386 works perfectly. Why doesn't ppcx64 work at all?

Using simply wrong hyperboles is not productive. I explained in my previous message, which you quoted below, why you cannot use a cross-compiler (such as the ppcx64 included with FPC releases on Mac OS X) to build FPC from trunk without using a special make option, and which exact make option you have to add so that it does work. Alternatively, use a cross-compiler like the one you built above. It's x86-64 binaries will be exactly the same as the ones generated by a native x86-64 compiler.

>> ------------Lazarus Build Problems------------ > That's because ppcx64 on Mac OS X is an i386->x86-64 cross-compiler and the Makefiles are not designed for bootstrapping with cross-compilers. You can work around it by adding CPU_SOURCE=x86_64, but you can just as well build a new cross-compiler. I just need something that works. It's a goal to have 64bit support for my downloads. I like to have a 64bit build of FPC like on Linux.

If you just need something that works, use the cross-compiler. If you want a native 64 bit build, you can create one as shown above.

Jonas

Reply by email

Andrew Brunner
to Jonas Maebe
Jonas Maebe wrote 8 lines
Using simply wrong hyperboles is not productive. I explained in my previous message, which you quoted below, why you cannot use a cross-compiler (such as the ppcx64 included with FPC releases on Mac OS X) to build FPC from trunk without using a special make option, and which exact make option you have to add so that it does work. Alternatively, use a cross-compiler like the one you built above. It's x86-64 binaries will be exactly the same as the ones generated by a native x86-64 compiler.

Yeah, I missed that point. From an end-user prospective though my assertion makes a lot of sense.

Using 2.6.2 in production builds here is not possible. My code-base uses HEAVY namespace implements. 2.7.1 is the only thing that compiles my projects.

make clean all DEBUG=1 OS_TARGET=darwin CPU_TARGET=x86_64 CPU_SOURCE=x86_64

Removing the PP=... was the only way I could get :-) build-stamp.x86_64-darwin

Thanks Jonas!

Reply by email

Schindler Karl-Michael
Show quoted text 11 lines
Date: Mon, 25 Nov 2013 15:33:08 -0600 From: Andrew Brunner Subject: Re: [fpc-devel] Problems with building x86_64 on darwin Message-ID: Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Lazarus cannot yet be compiled for x86-64 on Mac OS X (except if you > compile it for GTK or Qt, possibly). Unless you are editing files that > are larger than 1.5GB, it's unlikely you'd notice any difference either. Ok. At least I know it's not supported yet.

I had a try with 1.0.14 and with the following command, I can obtain a working version of a GTK2 based lazarus. The gtk2 libs are from fink.

make all LCL_PLATFORM=gtk2 OPT="-gl -gw -dHasX -Fl/sw/lib/pango-ft219/lib/ -k-framework -kApplicationServices"

I did not make extensive test, but a minimal example worked. With a different source for gtk2 libs, you may need some adjustments, for example replace /sw by /usr/local.

MiSchi

Reply by email