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

Compile fails on aarch64 with -fpic error #30556

Closed
asfimport opened this issue Dec 9, 2021 · 4 comments
Closed

Compile fails on aarch64 with -fpic error #30556

asfimport opened this issue Dec 9, 2021 · 4 comments

Comments

@asfimport
Copy link

On trying to install the R package (v. 6.0.1) on aarch64 the C++ package builds successfully but then the installation fails with the error

/usr/bin/ld: /tmp/RtmpFxiJjo/R.INSTALL25d336ebab6c6/arrow/src/../inst/include/cpp11/protect.hpp:38: warning: too many GOT entries for -fpic, please recompile with -fPIC

Environment: System: Oracle Cloud, Ampere A1 instance, Ubuntu 20.04
R version: 4.1.2
CMake version: 3.16.3
g++ version: 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
Reporter: Jyotirmoy Bhattacharya

Note: This issue was originally created as ARROW-15039. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Jyotirmoy Bhattacharya:
A workaround is to add the following to ~/.R/Makevars

CPICFLAGS=-fPIC
CXXPICFLAGS=-fPIC
CXX11PICFLAGS=-fPIC
CXX14PICFLAGS=-fPIC
CXX17PICFLAGS=-fPIC
CXX20PICFLAGS=-fPIC
FPICFLAGS=-fPIC

@asfimport
Copy link
Author

Neal Richardson / @nealrichardson:
We don't do anything to set or unset -fPIC in the arrow package, so you may want to look into why these weren't set on your system.

@asfimport
Copy link
Author

Jyotirmoy Bhattacharya:
This happened with R built from source. So the flag must have been configured when R was built. 

@amoeba
Copy link
Member

amoeba commented Sep 13, 2023

Just in case anyone else runs into this, I can also reproduce this on a fresh Ubuntu 22.03 VM running on aarch64 with the pre-built r-base package (i.e., not a source install).

$ uname -a
Linux ubuntu 5.15.0-83-generic #92-Ubuntu SMP Mon Aug 14 09:34:05 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

# I assume this controls the default set of compiler flags
$ cat /etc/R/Makeconf | grep -i pic
CPICFLAGS = -fpic
CXXPICFLAGS = -fpic
CXX11PICFLAGS = -fpic
CXX14PICFLAGS = -fpic
CXX17PICFLAGS = -fpic
CXX20PICFLAGS = -fpic
...snip

Setting ~/.R/Makevars as suggested in #30556 (comment) fixes it under my environment too. I'm not sure a change is needed at this point or what that change might be but I did want to share the above info.

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

No branches or pull requests

2 participants