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

ignoring file bcrypt/libstatbcrypt.a when homebrew/binutils was installed #67

Closed
randy3k opened this issue Mar 26, 2019 · 3 comments
Closed

Comments

@randy3k
Copy link

randy3k commented Mar 26, 2019

I am on a macOS. I got the following error when trying to install openssl 1.3 from source.

ar rcs bcrypt/libstatbcrypt.a bcrypt/bcrypt_pbkdf.o bcrypt/blowfish.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/X11/lib -L/usr/local/opt/gettext/lib -o openssl.so aes.o base64.o bignum.o cert.o compatibility.o diffie.o envelope.o error.o hash.o info.o keygen.o keys.o onload.o openssh.o password.o pbkdf.o pem.o pkcs12.o pkcs7.o rand.o rsa.o signing.o ssl.o stream.o write.o -Lbcrypt -lstatbcrypt -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/openssl/lib -lssl.1.1 -lcrypto.1.1 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: ignoring file bcrypt/libstatbcrypt.a, file was built for archive which is not the architecture being linked (x86_64): bcrypt/libstatbcrypt.a
installing to /Users/Randy/Library/R/3.5/library/openssl/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘openssl’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/Randy/Library/R/3.5/library/openssl/libs/openssl.so':
  dlopen(/Users/Randy/Library/R/3.5/library/openssl/libs/openssl.so, 6): Symbol not found: _bcrypt_pbkdf
  Referenced from: /Users/Randy/Library/R/3.5/library/openssl/libs/openssl.so
  Expected in: flat namespace
 in /Users/Randy/Library/R/3.5/library/openssl/libs/openssl.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/Randy/Library/R/3.5/library/openssl’
* restoring previous ‘/Users/Randy/Library/R/3.5/library/openssl’

The downloaded source packages are in
	‘/private/var/folders/w9/7w10svxj5093z4831n7m27w00000gp/T/RtmplaM1sx/downloaded_packages’
Warning message:
In install.packages("openssl") :
  installation of package ‘openssl’ had non-zero exit status

With some digging, it seems to be related to the command ar which I installed via homebrew/binutils. The installation process works fine once I unlink the binutils. I am not sure if there is any fix for homebrew/binutils. I just want to post the issue here in case someone will encounter the same issue.

@jeroen
Copy link
Owner

jeroen commented Mar 26, 2019

I think this is the reason that homebrew binutils is keg_only and hence won't be linked by default: https://github.com/Homebrew/homebrew-core/blob/master/Formula/binutils.rb#L14-L15

How did you accomplish this anyway? Homebrew won't let me do this:

# brew link --force binutils
Warning: Refusing to link macOS-provided software: binutils
If you need to have binutils first in your PATH run:
  echo 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> ~/.bash_profile

For compilers to find binutils you may need to set:
  export LDFLAGS="-L/usr/local/opt/binutils/lib"
  export CPPFLAGS="-I/usr/local/opt/binutils/include"

Though I am surprised that the newer version of AR generates binaries that are apparently incompatible with the default linker from xcode.

@randy3k
Copy link
Author

randy3k commented Mar 26, 2019

I installed binutils a long time ago and I was able to force link it at that time. I just tried again force linking it and it gave the same error message as yours.

@jeroen
Copy link
Owner

jeroen commented Mar 26, 2019

OK so I think this should no longer be an issue with current homebrew. But thanks for raising this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants