libscrypt icon indicating copy to clipboard operation
libscrypt copied to clipboard

`ld: unknown option: -z` error for osx build

Open chenrui333 opened this issue 3 years ago • 2 comments

👋 trying to build the latest release, but run into some build issue. The error log is as below:

build error
  ==> make check LDFLAGS= CFLAGS_EXTRA=
  clang  -D_FORTIFY_SOURCE=2 -fPIC   -c -o main.o main.c
  clang  -D_FORTIFY_SOURCE=2 -fPIC   -c -o crypto_scrypt-hexconvert.o crypto_scrypt-hexconvert.c
  ln -s -f libscrypt.so.0 libscrypt.so
  clang -o reference main.o b64.o crypto_scrypt-hexconvert.o  -D_FORTIFY_SOURCE=2 -fPIC -Wl,-z,relro -L.  -lscrypt
  ld: unknown option: -z
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make: *** [reference] Error 1

full build log, https://github.com/Homebrew/homebrew-core/runs/5154594733 relates to Homebrew/homebrew-core#94934

chenrui333 avatar Apr 17 '22 02:04 chenrui333

Hi,

Unfortunately I have no access to Mac environment and I'm going to need a Mac user to provide advise and a PR for this.

technion avatar May 05 '22 03:05 technion

The issue is that relro is an ELF thing and doesn't really mean anything on a Mach-O system as far as I can tell.

risicle avatar May 21 '22 16:05 risicle