FiloSottile / homebrew-musl-cross

Homebrew Formula for static-friendly musl-based GCC macOS-to-Linux cross-compilers
https://blog.filippo.io/easy-windows-and-linux-cross-compilers-for-macos/
ISC License
547 stars 45 forks source link

Linkage issues with cross-compiling OpenSSL #21

Closed LoganDark closed 4 years ago

LoganDark commented 4 years ago

I'm trying to cross-compile OpenSSL and it wanted linux/mmap.h. So I symlinked /usr/local/Cellar/musl-cross/0.9.9/libexec/x86_64-linux-musl/include/sys to /usr/local/Cellar/musl-cross/0.9.9/libexec/x86_64-linux-musl/include/linux and it worked - up until OpenSSL wanted linux/version.h.

So I went over to Ubuntu's linux-libc-dev-amd64-cross package and extracted that into /usr/local/Cellar/musl-cross/0.9.9/libexec/x86_64-linux-musl/. Then everything broke but that's because I forgot to remove the symlink.

So after removing the symlink, everything built successfully, but at the linking step, this happened:

image

image

image

Do you know what this means? Or how to fix it?

LoganDark commented 4 years ago

Wow. Ok. So apparently I didn't set all the environment variables I needed to.

So I read https://github.com/richfelker/musl-cross-make/issues/65#issuecomment-523959275 and decided to set all those while running make. Didn't work. So I ran Configure again with them, then ran make with them. Didn't work. However, after running make clean and then make again, it DID work with no errors!