-
Notifications
You must be signed in to change notification settings - Fork 165
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
Tectonic fails to build when link time optimization is enabled #795
Comments
Hmm, it looks like this might be related to the interdependencies amongst the various supporting C libraries that combine to create the |
@pkgw At the moment since the LTO flag is now the default in Archlinux the package fails. The easiest fix is to add to the PKGBUILD:
Alternatively I managed to get some progress with linking the
Note the use of |
I suspect, since there has been a number of Also maybe note which version of ld the error is coming from can probably pass |
@ratmice tried with the below PKGBUILD and it fails during testing diff --git a/PKGBUILD b/PKGBUILD
index 2d5bae9..87e805d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,18 +18,34 @@ pkgdesc='Modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX
url=https://tectonic-typesetting.github.io/
license=('MIT')
depends=('fontconfig' 'harfbuzz-icu' 'openssl')
-makedepends=('cargo' 'pkg-config')
+makedepends=('cargo' 'pkg-config' 'clang' 'lld')
source=("$pkgname-$pkgver.tar.gz::https://crates.io/api/v1/crates/$pkgname/$pkgver/download")
sha512sums=('4750b32621f5557bd4ef885445898b1b555461bc30cf8476a9fb2a76b008d7378664465f4cd6b1b8ddc7305cd24bda4a6d865ec925fad64edcd9e4a302d70b21')
build() {
cd $pkgname-$pkgver
- cargo build --release --locked --features external-harfbuzz
+ if [[ $CFLAGS = *-flto* ]]; then
+ local rustflags=(
+ -C linker=clang
+ -C linker-plugin-lto
+ -C link-args="$CFLAGS -fuse-ld=lld"
+ -C link-arg=-Wl,--no-as-needed
+ -C link-arg=-Wl,--version
+ )
+ IFS=$'\x1f'
+ export CARGO_ENCODED_RUSTFLAGS="${rustflags[*]}"
+ unset IFS
+ export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
+ export CARGO_PROFILE_RELEASE_LTO=fat
+ export CC=clang
+ export CXX=clang++
+ fi
+ cargo build --release --locked --verbose --features external-harfbuzz
}
check() {
cd $pkgname-$pkgver
- cargo test --release --locked --features external-harfbuzz
+ cargo test --release --locked --verbose --features external-harfbuzz
}
package() { Side-note: during tests one of them creates a |
yeah sorry I should have noted Unhelpfully it seems like cargo filtered out linker output and just output the command line, |
The other thing I should note is that So setting it may not be having the effect. I think we need to look into rustc to see if there is a setting to disable it maybe. |
Some bugs and various issues, regarding getting rustc to disable this, |
If helpful here's the log of |
LTO flag was added as a choice flag when building packages in Archlinux recently. When enabled,
build
fails during build.From
makepkg.conf
man page:https://man.archlinux.org/man/makepkg.conf.5
Full logs with and without LTO attached.
out-no-lto.log
out.log
The text was updated successfully, but these errors were encountered: