Skip to content

fix pgml conflicts with plpython #931

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

Merged
merged 3 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 .github/workflows/ubuntu-packages-and-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
libpython3.10-dev \
python3.10-dev \
ruby \
mold
lld

curl -sLO https://github.com/deb-s3/deb-s3/releases/download/0.11.4/deb-s3-0.11.4.gem
sudo gem install deb-s3-0.11.4.gem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ postgresql-server-dev-${POSTGRES_VERSION}
python3
python3-pip
libpython3
mold
lld
```

##### Rust
Expand Down
4 changes: 2 additions & 2 deletions pgml-extension/.cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup,-fuse-ld=/usr/bin/mold"]
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup,-fuse-ld=lld"]

[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup,-fuse-ld=/usr/bin/mold"]
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup,-fuse-ld=lld"]
12 changes: 12 additions & 0 deletions pgml-extension/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,16 @@ fn main() {
println!("cargo:rustc-link-search=/opt/homebrew/opt/openblas/lib");
println!("cargo:rustc-link-search=/opt/homebrew/opt/libomp/lib");
}

// PostgreSQL is using dlopen(RTLD_GLOBAL). this will parse some
// of symbols into the previous opened .so file, but the others will use a
// relative offset in pgml.so, and will cause a null-pointer crash.
//
// hid all symbol to avoid symbol conflicts.
//
// append mode (link-args) only works with clang ld (lld)
println!(
"cargo:link-args=-Wl,--version-script={}/ld.map",
std::env::current_dir().unwrap().to_string_lossy(),
);
}
8 changes: 8 additions & 0 deletions pgml-extension/ld.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
global:
Pg_magic_func;
_PG_init;
*_wrapper;
local:
*;
};
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy