FiloSottile / homebrew-musl-cross

Homebrew Formula for static-friendly musl-based GCC macOS-to-Linux cross-compilers

Home Page:https://blog.filippo.io/easy-windows-and-linux-cross-compilers-for-macos/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linkage issues with cross-compiling OpenSSL

LoganDark opened this issue · comments

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?

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

So I read richfelker/musl-cross-make#65 (comment) 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!