Closed shepherdjerred closed 1 year ago
Managed to get this working: https://github.com/tpoechtrager/osxcross/pull/376
There are a ton of warnings about linking to iOS, but the binaries seem to work fine. @iains if you have a little bit of time, could you give me some advice on how to resolve this warning? It'd make it much nicer when using this project as a cross-compiler on Linux :)
ld: building for macOS, but linking in object file built for iOS, file '_muldi3_s.o' for architecture arm64
I've changed that error to a warning in the ld
source with this patch:
diff --git a/cctools/ld64/src/ld/PlatformSupport.cpp b/cctools/ld64/src/ld/PlatformSupport.cpp
index 4869542..e081478 100644
--- a/cctools/ld64/src/ld/PlatformSupport.cpp
+++ b/cctools/ld64/src/ld/PlatformSupport.cpp
@@ -105,7 +105,7 @@ void VersionSet::checkObjectCrosslink(const VersionSet& objectPlatforms, const s
if (enforce == PlatEnforce::warnInternalErrorExternal) {
enforce = (internalSDK ? PlatEnforce::warning : PlatEnforce::error);
}
- if ( platformMismatchesAreWarning && (enforce == PlatEnforce::error) )
+ if ( true && (enforce == PlatEnforce::error) )
enforce = PlatEnforce::warning;
switch (enforce) {
case PlatEnforce::allow:
Managed to get this working. I needed to set MACOSX_DEPLOYMENT_TARGET
before configuring/building GCC. Proof-of-concept here: https://github.com/shepherdjerred/macos-cross-compiler
Hello! To start out, thanks for the work you've done on this project.
Sorry that I can't be more detailed/precise. I have very little knowledge of GCC/compilers.
I'm using the osxcross project to build binaries targeting macOS on Linux. The project builds cctools, which are then used when compiling GCC. I'm trying to modify the project to support building binaries for macOS arm64 using this branch of GCC. I've modified the project to clone this repository and run the following commands to build GCC:
GCC fails with the following error:
I believe this may be related to this statement in darwinpcs.md:
I know that this project is completely unrelated from the osxcross project. I was hoping there would be an easy way to change the objects that GCC is outputting, so that they are identified as
macOS
rather thaniOS
, so thatld
correctly links.