Does a single cross compiler for a CPU used for all operating systems?

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

Does a single cross compiler for a CPU used for all operating systems?

vfclists .
Does a single cross compiler for a CPU used for all operating systems?

eg ppcross386 is the cross compiler for i386. Is it the same compiler that would be used whether the target was a 32bit Linux, OS/X or Win32, with different linkers and libraries used for the final executable?

--
Frank Church

=======================
http://devblog.brahmancreations.com

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

Re: Does a single cross compiler for a CPU used for all operating systems?

Sven Barth-2
On 30.03.2015 21:33, vfclists . wrote:
> Does a single cross compiler for a CPU used for all operating systems?
>
> eg ppcross386 is the cross compiler for i386. Is it the same compiler
> that would be used whether the target was a 32bit Linux, OS/X or Win32,
> with different linkers and libraries used for the final executable?

That is correct. (an exception to this is ARM hard float which requires
a different compiler binary than ARM soft float - if I remember correctly)

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
|

GCC -PIE equivalent?

Jon Foster
I'm building native code compilers for Android. I've been assisting the
PascalDevelop project available in the Play Store:

https://play.google.com/store/apps/details?id=com.assoft.PascalDevelop

I'm working with the 3.0.0rc2 release and building whichever units will.
The current version of the app ships with the older 2.6.x compiler.

What we've discovered is that if we try to run the compiler on Android 5
(Lollipop) or greater the binary won't load and complains that it isn't
a "Position Independent Executable" (PIE). This is a feature similar to
PIC. In GCC they have a separate flag -fPIE as opposed to the -fPIC. The
purpose is to make the whole executable relocatable to facilitate
"randomized address spaces".

If I build a standard "program" (not library) with -Cg do I get a PIE...
or does that only affect linking for libraries? I haven't been able to
find anything on the iNet regarding PIE and FPC.

THX - Jon

--
Sent from my Debian Linux laptop -- http://www.debian.org/intro/about

Jon Foster
JF Possibilities, Inc.
[hidden email]
541-410-2760
Making computers work for you!

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

Re: GCC -PIE equivalent?

Adriaan van Os-2
Jon Foster wrote:
> If I build a standard "program" (not library) with -Cg do I get a PIE...
> or does that only affect linking for libraries? I haven't been able to
> find anything on the iNet regarding PIE and FPC.

Wouldn't that just be a linker option, passed-on to ld ?

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

Re: GCC -PIE equivalent?

Sven Barth-2

Am 13.11.2015 16:05 schrieb "Adriaan van Os" <[hidden email]>:
>
> Jon Foster wrote:
>>
>> If I build a standard "program" (not library) with -Cg do I get a PIE...
>> or does that only affect linking for libraries? I haven't been able to
>> find anything on the iNet regarding PIE and FPC.
>
>
> Wouldn't that just be a linker option, passed-on to ld ?

Not if the compiler needs to ensure that the code it generates is generated position independently as well. I don't know though in how far the requirements for PIC are different from PIE.

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: GCC -PIE equivalent?

Jonas Maebe-2
In reply to this post by Jon Foster
On 12/11/15 17:12, Jon Foster wrote:

> What we've discovered is that if we try to run the compiler on Android 5
> (Lollipop) or greater the binary won't load and complains that it isn't
> a "Position Independent Executable" (PIE). This is a feature similar to
> PIC. In GCC they have a separate flag -fPIE as opposed to the -fPIC. The
> purpose is to make the whole executable relocatable to facilitate
> "randomized address spaces".
>
> If I build a standard "program" (not library) with -Cg do I get a PIE...
> or does that only affect linking for libraries? I haven't been able to
> find anything on the iNet regarding PIE and FPC.

The problem is that the startup code for Android, which is handwritten
assembly and hence not affected by any compiler switches, contains
non-PIC code.

This has been fixed in trunk fairly recently, but it was too late for 3.0.


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