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

fix: add -z noexecstack in Makevars #1212

Merged
merged 7 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ Collate:
'zzz.R'
Config/rextendr/version: 0.3.1
VignetteBuilder: knitr
Config/polars/LibVersion: 0.42.0
Config/polars/LibVersion: 0.42.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this change necessary?
Isn't this flag unrelated to the Rust binary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it wasn't, I think I misinterpreted the failures in the first commit because I've been bitten before by compilation errors when I forgot to update the libversion

Config/polars/RustToolchainVersion: nightly-2024-07-26
5 changes: 4 additions & 1 deletion src/Makevars.in
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! The flag you found goes to the linker, not cargo itself. The location should be somewhere that gets passed to R's build step of the package, in which the linker is invoked (oddly enough, the linker interface is gcc too lol). I think you can start by putting this in PKG_LIBS line and see if it helps.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, let's see how it goes

Copy link
Collaborator Author

@etiennebacher etiennebacher Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CGMossa it seems that this flag only exists on Linux (just my guess since ubuntu passes but macos workflows fail with ld: unknown options: -z ). Any idea how to fix it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I think this option should go in the configure file, no makevars.in

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ $(SHLIB): $(STATLIB)

CARGOTMP = $(CURDIR)/.cargo

# -z noexecstack added to avoid following error on Ubuntu:
# /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /usr/local/lib/R/site-library/polars/libs/polars.so)`
# https://stackoverflow.com/questions/73435637/how-can-i-fix-usr-bin-ld-warning-trap-o-missing-note-gnu-stack-section-imp/73468271#73468271
$(STATLIB):
if [ -f "$(CURDIR)/../tools/$(LIBNAME)" ]; then \
mkdir -p "$(LIBDIR)" ; \
Expand All @@ -26,7 +29,7 @@ $(STATLIB):
fi && \
export PATH="$(PATH):$(HOME)/.cargo/bin" && \
cargo build --lib --manifest-path="$(CURDIR)/rust/Cargo.toml" --target-dir "$(TARGET_DIR)" --target="$(TARGET)" \
--profile="$(LIBR_POLARS_PROFILE)" --features="$(LIBR_POLARS_FEATURES)"
--profile="$(LIBR_POLARS_PROFILE)" --features="$(LIBR_POLARS_FEATURES)" -z noexecstack

if [ "true" != "true" ]; then \
rm -Rf "$(CARGOTMP)" "$(LIBDIR)/build"; \
Expand Down
2 changes: 1 addition & 1 deletion src/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "r-polars"
version = "0.42.0"
version = "0.42.1"
edition = "2021"
rust-version = "1.80.0"
publish = false
Expand Down
6 changes: 0 additions & 6 deletions tools/lib-sums.tsv

This file was deleted.

Loading