Skip to content
Closed
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: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'src/**.rs'
- 'tests/**'
- 'Cargo.toml'
- 'build.rs'
- 'opus/**/*'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
Expand All @@ -19,6 +20,7 @@ on:
- 'src/**.rs'
- 'tests/**'
- 'Cargo.toml'
- 'build.rs'
- 'opus/**/*'
jobs:
check:
Expand Down
14 changes: 13 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,19 @@ fn build() {
.define("CMAKE_INSTALL_INCLUDEDIR", "include")
.define("CMAKE_INSTALL_OLDINCLUDEDIR", "include")
.define("CMAKE_INSTALL_LIBDIR", "lib")
.define("CMAKE_TRY_COMPILE_TARGET_TYPE", "STATIC_LIBRARY");
.define("CMAKE_TRY_COMPILE_TARGET_TYPE", "STATIC_LIBRARY")
// The bundled libopus.a is consumed by rustc (bundled into the
// rlib), not the C link, so C-level LTO gains nothing here. If the
// ambient CFLAGS contain `-flto` (e.g. Arch's makepkg with
// `OPTIONS=(lto)`, Gentoo `LTOFLAGS`, distros enabling it by
// default), GCC produces slim LTO objects: empty `.text`, code only
// in `.gnu.lto_*` sections, marked with `__gnu_lto_slim`. rust-lld
// links the rlib without an LTO plugin and reports the opus_*
// symbols as undefined. Force LTO off here regardless of inherited
// flags. `-fno-lto` overrides any preceding `-flto*` (gcc/clang
// honor the last one) and is a no-op for compilers that don't
// recognize it.
.cflag("-fno-lto");

//Keep this up to date with Cargo.toml
if cfg!(feature = "dred") {
Expand Down
Loading