Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apple-darwin-osxcross] Issues with symlinks and target location. #81

Closed
denisfa opened this issue Dec 3, 2018 · 4 comments
Closed
Labels

Comments

@denisfa
Copy link

denisfa commented Dec 3, 2018

After a clean install, I removed the folder where the PKGBUILD was (/home/denisfa/Downloads/apple-darwin-osxcross). Some scripts stopped working. After investigating, I wanted to report some of the errors found:

$ cd /opt/osxcross/bin && ls -l omp osxcross-macports osxcross-mp
lrwxrwxrwx 1 root root   82 Dec  1 16:22 omp -> /home/denisfa/Downloads/apple-darwin-osxcross/src/osxcross/tools/osxcross-macports
lrwxrwxrwx 1 root root   82 Dec  1 16:22 osxcross-macports -> /home/denisfa/Downloads/apple-darwin-osxcross/src/osxcross/tools/osxcross-macports
lrwxrwxrwx 1 root root   82 Dec  1 16:22 osxcross-mp -> /home/denisfa/Downloads/apple-darwin-osxcross/src/osxcross/tools/osxcross-macports

[1] As you can see, the symlinks are wrong. The osxcross-macports should have been copied to /opt/osxcross/bin and the other symlinks should point to this.

Following this, there was also a problem with x86_64-apple-darwin15-gcc. I tried to do a simple compilation test (attached as test.c).

$ x86_64-apple-darwin15-gcc -O2 -Wall -o test test.c
Assembler messages:
Fatal error: invalid listing option `r'

When debugging this error with strace, I found the following output:

$ strace x86_64-apple-darwin15-gcc -O2 -Wall -o test test.c
...
access("/home/denisfa/Downloads/apple-darwin-osxcross/src/osxcross/target/bin/../bin/x86_64-apple-darwin15-as", X_OK) = -1 ENOENT (No such file or directory)
stat("/opt/osxcross/bin/../libexec/gcc/x86_64-apple-darwin15/7.1.1/as", 0x7ffd80778f70) = -1 ENOENT (No such file or directory)
stat("/opt/osxcross/bin/../libexec/gcc/as", 0x7ffd80778f70) = -1 ENOENT (No such file or directory)
stat("/opt/osxcross/bin/x86_64-apple-darwin15/7.1.1/as", 0x7ffd80778f70) = -1 ENOENT (No such file or directory)
stat("/opt/osxcross/bin/as", 0x7ffd80778f70) = -1 ENOENT (No such file or directory)
stat("/opt/osxcross/bin/../lib/gcc/x86_64-apple-darwin15/7.1.1/../../../../x86_64-apple-darwin15/bin/x86_64-apple-darwin15/7.1.1/as", 0x7ffd80778f70) = -1 ENOENT (No such file or directory)
stat("/opt/osxcross/bin/../lib/gcc/x86_64-apple-darwin15/7.1.1/../../../../x86_64-apple-darwin15/bin/as", 0x7ffd80778f70) = -1 ENOENT (No such file or directory)
vfork()    

[2] Again, as you can see, the compiler tries to find x86_64-apple-darwin15-as where the PKGBUILD was (/home/denisfa/Downloads/apple-darwin-osxcross/), but it is in /opt/osxcross/bin. The full strace log is also in the zip.

Another linking situation is found on some header file:

$ find /opt/osxcross -type l -ls
...
lrwxrwxrwx 1 root root 156 Dec  1 16:22 /opt/osxcross/SDK/MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/stdbool.h -> /home/denisfa/Downloads/apple-darwin-osxcross/src/osxcross/target/SDK/MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/stdarg.h

This one was a little different, as I can't tell the right solution. Using diff on some files, I tried the following:

$ cd /opt/osxcross/SDK/MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/
$ unlink stdbool.h && ln -s stdarg.h ./stdbool.h

[3] This time, the only reason for me to do this was because the diff was empty. If I linked to the right file or not, I have no idea.

I am currently trying to check if this is some issue for the main osxcross repo, but I believe it is more an installation issue. I will update this if that is the case.

all.zip

@Martchus
Copy link
Owner

Martchus commented Dec 3, 2018

Note that all the apple-darwin-* packages are very experimental at this point. I have actually never tested the GCC compiler. I've just built GCC for libstdc++.

But with Clang I was able to build the entire Qt framework. Isn't that good enough? I suppose that's the way to go anyways so I would actually drop the GCC build and also use libc++ as standard library. See my previous comment on this package.

@denisfa
Copy link
Author

denisfa commented Dec 11, 2018

Hey @Martchus! Sorry for the long time without answer, too much stuff to do and little time =(

I agree with your approach of having multiple apple-darwin-*. I think it is actually better than shipping one huge thing with everything and then adding whatever users ask.

I am kinda curious as to how you want to package the SDK now. I tried the procedure from the osxcross repo for Xcode 10.1 and it was 10MB smaller than your package on AUR. Did you do anything special? It did not include gcc in my package.

Also, regarding your previous comment, I don't know what to think. I did a simple qt application and it worked perfectly. When you say there were reports of crashes, there can be multiple reasons. If the code compiles and the app crashes, it feels to me like a lib problem (looking at the wrong places for libs). This was true for me, since I had to look at where the .*dylib were and copied them to a local dir, compiled pointing to this dir, and then shipped them with the app for a MacOS High Sierra. Without this the app would crash on start (maybe this is an ugly workaround, I am not sure - Linux app dev here).

About [1],[2] and [3], I have yet to verify this. So I am leaving this open for now, but hopefully I will finish this week.

@Martchus
Copy link
Owner

Sorry for the long time without answer, too much stuff to do and little time

Same here. That's why I didn't make any progress on the osxcross packages.

When you say there were reports of crashes, there can be multiple reasons.

Of course. Maybe even just a platform specific bug in my application.

I am kinda curious as to how you want to package the SDK now.

I don't know. I'm not really into the topic anymore.


By the way, if you can share any improvements, feel free to open a PR here or share a link to your own repository/PKGBUILD.

@stale
Copy link

stale bot commented Apr 14, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 14, 2022
@stale stale bot closed this as completed Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants