-
Notifications
You must be signed in to change notification settings - Fork 317
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
Always build with -fPIC on Linux and BSD #627
Conversation
Following some out-of-band discussion with @stuartarchibald, it seems like it makes more sense to just always build with |
Also @stuartarchibald pointed out to me that |
@gmarkall thanks for submitting this, I have added it to the queue for review. |
Section contents were truncated at null bytes because `c_char_p` implies a null-terminated string. Swapping the return type of `LLVMPY_GetSectionContents` for a `POINTER(c_char)` no longer implies this. Test case added based on the reproducer in numba#632.
This reverts commit 0865730, which was accidentally included on this branch.
ffi/Makefile.freebsd
Outdated
LDFLAGS := $(LDFLAGS) $(LLVM_LDFLAGS) $(LD_FLTO_FLAGS) | ||
LDFLAGS = $(LLVM_LDFLAGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest removing this as its overwriting the line above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove.
CXXFLAGS := $(CPPFLAGS) $(CXXFLAGS) $(LLVM_CXXFLAGS) $(CXX_FLTO_FLAGS) | ||
LDFLAGS := $(LDFLAGS) $(LLVM_LDFLAGS) $(LD_FLTO_FLAGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth adding
Lines 5 to 6 in 4acef2d
CXX_FLTO_FLAGS ?= -flto | |
LD_FLTO_FLAGS ?= -flto -Wl,--exclude-libs=ALL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes. Patch looks good, also tests out ok on OpenBSD.
@esc any chance you could trigger a test wheel build of this please? |
BFID: |
So, the wheel-build was fine for all architectures, i.e. build artifacts were produced. We currently don't have any automation however to actually run tests on the wheels. |
I spot checked OSX and Linux x86_64 and both are fine. |
Thanks for building and testing @esc, think this is good to go. |
Agreed! |
EDIT: Title changed to reflect the fact that this PR now always builds with
-fPIC
on Linux and BSD, instead of requiring the user to specify it as an option. Original PR comment follows:On systems that do not build PIC by default, linking libllvmlite.so fails (see e.g. the error reported in #553). This PR adds an option to the
build_ext
command in setup.py (--pic
) to compile with-fPIC
.Related issues: #553, #542, #522 - this PR may address some of these issues.
In my case, I need to use this option when building on Ubuntu 18.04 with the system compiler, but from the above issues it seems that there are other systems that require the flag as well.