-
Notifications
You must be signed in to change notification settings - Fork 277
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
Adding link flags for the static version #2287
Comments
On Tue 21 May 05:00, Alexander Leidinger wrote:
Hi,
when I use LDFLAGS=XXX those flags are only applied to the dynamic linking, the pkg-static build doesn't see them.
Example with -fsanitize=cfi (dynamic build has all the options, static build hasn't):
```
--- pkg ---
cc -o pkg add.o alias.o annotate.o audit.o autoremove.o check.o clean.o config.o create.o delete.o event.o fetch.o globals.o info.o install.o key.o lock.o main.o plugins.o query.o register.o repo.o rquery.o search.o set.o shell.o shlib.o ssh.o stats.o triggers.o update.o updating.o upgrade.o utils.o version.o which.o -Wl,-znow -fsanitize=cfi -fvisibility=hidden -fsanitize-cfi-cross-dso -flto=thin -fno-sanitize-trap=all -fsanitize-recover=all -pie -Wl,-zrelro -fstack-protector-strong -Wl,-Bstatic -Wl,-whole-archive -L/wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.21.2/libpkg -lpkg_flat -Wl,-no-whole-archive -Wl,-Bdynamic -lelf -ljail -lssl -lcrypto -larchive -lbz2 -lz -llzma -lprivatezstd -lm -pthread -lutil -lmd -Wl,--export-dynamic
--- pkg-static ---
cc -o pkg-static add.o alias.o annotate.o audit.o autoremove.o check.o clean.o config.o create.o delete.o event.o fetch.o globals.o info.o install.o key.o lock.o main.o plugins.o query.o register.o repo.o rquery.o search.o set.o shell.o shlib.o ssh.o stats.o triggers.o update.o updating.o upgrade.o utils.o version.o which.o -static -L/wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.21.2/libpkg -lpkg_flat -lelf -ljail -lssl -lcrypto -larchive -lbz2 -lz -llzma -lprivatezstd -lm -pthread -lutil -lmd
--- pkg ---
ld: error: undefined symbol: __cfi_slowpath_diag
>>> referenced by event.c
>>> pkg.lto.event.o:(cleanup_handler.52c52c1eb832dce3a09137c36f3b0e8a.cfi)
>>> referenced by ucl_emitter_utils.c
>>> /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.21.2/libpkg/pkg.lto.libpkg_flat.a(ucl_emitter_utils.o at 3229650).o:(ucl_elt_string_write_json.cfi)
>>> referenced by ucl_emitter_utils.c
>>> /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.21.2/libpkg/pkg.lto.libpkg_flat.a(ucl_emitter_utils.o at 3229650).o:(ucl_elt_string_write_json.cfi)
>>> referenced 3030 more times
cc: error: linker command failed with exit code 1 (use -v to see invocation)
LDFLAGS is properly passed
https://github.com/freebsd/pkg/blob/094472054da46c966f4aaf77f8e3f683b8e7f74e/src/Makefile.autosetup#L98
I don't know why throught ports it does not find its way.
Best regards,
Bapt
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
when I use LDFLAGS=XXX those flags are only applied to the dynamic linking, the pkg-static build doesn't see them.
Example with -fsanitize=cfi (dynamic build has all the options, static build hasn't):
Bye,
Alexander.
The text was updated successfully, but these errors were encountered: