Skip to content

Commit

Permalink
src/poky:rust-common: add LDFLAGS to 'build-rust-cc' wrapper
Browse files Browse the repository at this point in the history
Although rust differs between compiling (--> 'rust-cc' wrapper) and
linking (--> 'rust-ccld' wrapper), some core crates are using only the
'rust-cc' wrapper to check for available compiler options [1] and
libraries [2].

Not having LDFLAGS can break the build in subtle ways.  E.g. 'cargo-native'
can fail to build with

|   = note: .../hosttools/ld: .../liblibz_sys-....rlib(deflate.o):
|     relocation R_X86_64_32S against hidden symbol `_length_code' can not be used when making a PIE object

because it does not find '-lz' (added by "DEPENDS = zlib") and builds
a static libz.a with missing PIC flags.

Add LDFLAGS to the 'build-rust-cc' wrapper as it is done already for
the target one.

[1] rust-lang/cc-rs#1322

[2] https://github.com/rust-lang/libz-sys/blob/12a32798c6bd18986cb5cd603359b03c96f0eb4c/build.rs#L228-L234

(From OE-Core rev: 49b37575b548f0ab082c700f91fdd856740dc829)

Signed-off-by: Enrico Scholz <enrico.scholzsigma-chemnitz.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briandbootlin.com>
Signed-off-by: Ross Burton <ross.burtonarm.com>
  • Loading branch information
ensc authored and rossburton committed Jan 23, 2025
1 parent 6dc3551 commit 26756b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/poky
Submodule poky updated from 921b46 to df026a

0 comments on commit 26756b3

Please # to comment.