Closed jlbirccyn closed 1 year ago
Seems fine to me. If I have understood correctly, you would add the goil/templates/config/posix/darwin/arm64
and put the relevant CFLAGS
and LDFLAGS
in each goil/templates/config/posix
subarchitecture.
Yes, and goil/templates/config/posix/linux
too
Seems OK for me too. Given that there are still some X86-64 darwin machines around, should we also have a corresponding target? In the same vein, should we have subdirectories in linux?
It seems to me that goil/templates/config/posix/linux
is already existing. It works fine on Debian and Ubuntu, which are the most used development systems nowadays. I think that the Linux part can stay as it is to ease maintenance.
Given that there are still some X86-64 darwin machines around, should we also have a corresponding target? In the same vein, should we have subdirectories in linux?
Since X86-64 Darwin is the lowest common denominator (needs only the -lpthread
option), it compiles with --target=posix/darwin
only.
As Adrien said linux is already there. So we would have in the end:
--target=posix/linux
--target=posix/darwin
--target=posix/darwin/arm64
Done with 1aa8c1a9f6743bc8b9ee270a5db7fdc14d402a2d
From the very beginning, the POSIX port has been slightly different between Mac OS X and Linux when building an application. Indeed, on Linux, certain functions linked to the management of semaphores used for synchronization between Trampoline and Viper are in the
librt
for historical reasons, whereas on Mac OS X they are in thelibsystem
.In addition, on Apple Silicon Macs (arm64), for some reason I can't explain, building a Trampoline application produces x86_64 code which is then run in emulation with Rosetta. This poses a problem for testing, as the
libEmbunit
is compiled in arm64 and linking between it and Trampoline is impossible. You need to add the-arch arm64
option to force native code generation.What I propose is to add subarchitectures to posix: linux, darwin and darwin/arm64 so as to put in
config.oil
of linuxLDFLAGS = "-rt";
and in theconfig.oil
ofdarwin/arm64
CFLAGS = "-arch arm64"
andLDFLAGS = "-arch arm64";
.