shm changes result in build failures with PGO #642

Closed
opened 3 months ago by dilyn-corner · 2 comments

Everything proceeds normally during the first build used to get profiling data, right up until the link step when I run into undefined symbol errors. These errors only appear starting at 232fb20269 - commits prior to this one are fine. There are additional errors using the latest master that come in from later commits, I've add that log below as well.

The build is fine when just doing a regular ol' meson . build and not trying to do the intervening PGO steps.

I had someone test building with PGO using gcc and binutil's ld and they had no issues. I'm building using llvm+clang+lld etc.

These builds are all done simply following the instructions from INSTALL.md, using bundled fcft and tllist.

The problem is nonobvious to me, and I'm more than happy to test ideas and fixes!

At commit 232fb20269

[98/98] Linking target pgo
ninja: job failed: cc  -o pgo pgo.p/meson-generated_.._xdg-shell.c.o pgo.p/meson-generated_.._xdg-decoration-unstable-v1.c.o pgo.p/meson-generated_.._xdg-output-unstable-v1.c.o pgo.p/meson-generated_.._primary-selection-unstable-v1.c.o pgo.p/meson-generated_.._presentation-time.c.o pgo.p/meson-generated_.._text-input-unstable-v3.c.o pgo.p/meson-generated_.._xdg-activation-v1.c.o pgo.p/pgo_pgo.c.o -flto -flto-jobs=0 -fprofile-generate -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -march=native -mtune=native -O3 -fno-math-errno -pipe -flto=thin -O3 -Wno-ignored-optimization-argument -Wno-backend-plugin -Wl,--start-group libpgolib.a libvtlib.a libcommon.a libmisc.a subprojects/fcft/libfcft.a -lm -pthread /usr/lib/libpixman-1.so /usr/lib/libwayland-client.so /usr/lib/libxkbcommon.so /usr/lib/libfontconfig.so /usr/lib/libfreetype.so /usr/lib/libharfbuzz.so -Wl,--end-group
ld: error: undefined symbol: shm_unref
>>> referenced by terminal.c
>>>               lto.tmp:(term_destroy)
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: subcommand failed

At 029920ddcc (Master)

[98/98] Linking target foot
ninja: job failed: cc  -o pgo pgo.p/meson-generated_.._xdg-shell.c.o pgo.p/meson-generated_.._xdg-decoration-unstable-v1.c.o pgo.p/meson-generated_.._xdg-output-unstable-v1.c.o pgo.p/meson-generated_.._primary-selection-unstable-v1.c.o pgo.p/meson-generated_.._presentation-time.c.o pgo.p/meson-generated_.._text-input-unstable-v3.c.o pgo.p/meson-generated_.._xdg-activation-v1.c.o pgo.p/pgo_pgo.c.o -flto -flto-jobs=0 -fprofile-generate -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -march=native -mtune=native -O3 -fno-math-errno -pipe -flto=thin -O3 -Wno-ignored-optimization-argument -Wno-backend-plugin -Wl,--start-group libpgolib.a libvtlib.a libcommon.a libmisc.a subprojects/fcft/libfcft.a -lm -pthread /usr/lib/libpixman-1.so /usr/lib/libwayland-client.so /usr/lib/libxkbcommon.so /usr/lib/libfontconfig.so /usr/lib/libfreetype.so /usr/lib/libharfbuzz.so -Wl,--end-group
ld: error: undefined symbol: shm_chain_new
>>> referenced by terminal.c
>>>               lto.tmp:(term_init)
>>> referenced by terminal.c
>>>               lto.tmp:(term_init)
>>> referenced by terminal.c
>>>               lto.tmp:(term_init)
>>> referenced 3 more times

ld: error: undefined symbol: shm_unref
>>> referenced by terminal.c
>>>               lto.tmp:(term_destroy)

ld: error: undefined symbol: shm_chain_free
>>> referenced by terminal.c
>>>               lto.tmp:(term_destroy)
>>> referenced by terminal.c
>>>               lto.tmp:(term_destroy)
>>> referenced by terminal.c
>>>               lto.tmp:(term_destroy)
>>> referenced 3 more times
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: subcommand failed
Everything proceeds normally during the first build used to get profiling data, right up until the link step when I run into undefined symbol errors. These errors only appear starting at 232fb20269b68157874f57d676c1b0b95c2386aa - commits prior to this one are fine. There are additional errors using the latest master that come in from later commits, I've add that log below as well. The build is fine when just doing a regular ol' `meson . build` and not trying to do the intervening PGO steps. I had someone test building with PGO using `gcc` and binutil's `ld` and they had no issues. I'm building using `llvm+clang+lld` etc. These builds are all done simply following the instructions from INSTALL.md, using bundled `fcft` and `tllist`. The problem is nonobvious to me, and I'm more than happy to test ideas and fixes! At commit 232fb20269b68157874f57d676c1b0b95c2386aa ``` [98/98] Linking target pgo ninja: job failed: cc -o pgo pgo.p/meson-generated_.._xdg-shell.c.o pgo.p/meson-generated_.._xdg-decoration-unstable-v1.c.o pgo.p/meson-generated_.._xdg-output-unstable-v1.c.o pgo.p/meson-generated_.._primary-selection-unstable-v1.c.o pgo.p/meson-generated_.._presentation-time.c.o pgo.p/meson-generated_.._text-input-unstable-v3.c.o pgo.p/meson-generated_.._xdg-activation-v1.c.o pgo.p/pgo_pgo.c.o -flto -flto-jobs=0 -fprofile-generate -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -march=native -mtune=native -O3 -fno-math-errno -pipe -flto=thin -O3 -Wno-ignored-optimization-argument -Wno-backend-plugin -Wl,--start-group libpgolib.a libvtlib.a libcommon.a libmisc.a subprojects/fcft/libfcft.a -lm -pthread /usr/lib/libpixman-1.so /usr/lib/libwayland-client.so /usr/lib/libxkbcommon.so /usr/lib/libfontconfig.so /usr/lib/libfreetype.so /usr/lib/libharfbuzz.so -Wl,--end-group ld: error: undefined symbol: shm_unref >>> referenced by terminal.c >>> lto.tmp:(term_destroy) clang-12: error: linker command failed with exit code 1 (use -v to see invocation) ninja: subcommand failed ``` At 029920ddcc00120b0480a64e5cac2114e529b59a (Master) ``` [98/98] Linking target foot ninja: job failed: cc -o pgo pgo.p/meson-generated_.._xdg-shell.c.o pgo.p/meson-generated_.._xdg-decoration-unstable-v1.c.o pgo.p/meson-generated_.._xdg-output-unstable-v1.c.o pgo.p/meson-generated_.._primary-selection-unstable-v1.c.o pgo.p/meson-generated_.._presentation-time.c.o pgo.p/meson-generated_.._text-input-unstable-v3.c.o pgo.p/meson-generated_.._xdg-activation-v1.c.o pgo.p/pgo_pgo.c.o -flto -flto-jobs=0 -fprofile-generate -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -march=native -mtune=native -O3 -fno-math-errno -pipe -flto=thin -O3 -Wno-ignored-optimization-argument -Wno-backend-plugin -Wl,--start-group libpgolib.a libvtlib.a libcommon.a libmisc.a subprojects/fcft/libfcft.a -lm -pthread /usr/lib/libpixman-1.so /usr/lib/libwayland-client.so /usr/lib/libxkbcommon.so /usr/lib/libfontconfig.so /usr/lib/libfreetype.so /usr/lib/libharfbuzz.so -Wl,--end-group ld: error: undefined symbol: shm_chain_new >>> referenced by terminal.c >>> lto.tmp:(term_init) >>> referenced by terminal.c >>> lto.tmp:(term_init) >>> referenced by terminal.c >>> lto.tmp:(term_init) >>> referenced 3 more times ld: error: undefined symbol: shm_unref >>> referenced by terminal.c >>> lto.tmp:(term_destroy) ld: error: undefined symbol: shm_chain_free >>> referenced by terminal.c >>> lto.tmp:(term_destroy) >>> referenced by terminal.c >>> lto.tmp:(term_destroy) >>> referenced by terminal.c >>> lto.tmp:(term_destroy) >>> referenced 3 more times clang-12: error: linker command failed with exit code 1 (use -v to see invocation) ninja: subcommand failed ```
dnkl referenced this issue from a commit 3 months ago
Owner

Huh, weird that we don't get the same linking errors with gcc... anyway, #643 should fix this.

Do you need a new release, or are you ok with carrying a patch?

Huh, weird that we don't get the same linking errors with gcc... anyway, https://codeberg.org/dnkl/foot/pulls/643 should fix this. Do you need a new release, or are you ok with carrying a patch?
dnkl added the
bug
label 3 months ago
dnkl closed this issue 3 months ago
dnkl referenced this issue from a commit 3 months ago
Poster

I'm fine with a patch! Thank you sir - worked like a charm.

I'm fine with a patch! Thank you sir - worked like a charm.
matthiasbeyer referenced this issue from a commit 2 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.