Bug 1416 - Build fails with LTO, apparent symbol clash between sr_driver_list function and section
Summary: Build fails with LTO, apparent symbol clash between sr_driver_list function a...
Status: RESOLVED FIXED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Build system (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-14 18:23 CEST by Stefan Brüns
Modified: 2019-10-07 00:22 CEST (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2019-09-14 18:23:16 CEST
Build fails when libsigrok is compiled with "-flto" flag:

[  105s] /tmp/cce0ArHz.s: Assembler messages:
[  105s] /tmp/cce0ArHz.s: Error: .size expression for sr_driver_list does not evaluate to a constant
[  105s] make[2]: *** [/tmp/ccGB2e2J.mk:35: /tmp/libsigrok.so.4.1.0.H7VyzI.ltrans11.ltrans.o] Error 1
[  105s] make[2]: *** Waiting for unfinished jobs....
[  105s] lto-wrapper: fatal error: make returned 2 exit status
[  105s] compilation terminated.
[  105s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: error: lto-wrapper failed
[  105s] collect2: error: ld returned 1 exit status


Changing the special driver section name from "sr_driver_list" to e.g. "_sr_driver_list" solves the problem. The latter is also used when compiling for MacOS.
Comment 1 Uwe Hermann 2019-10-07 00:22:03 CEST
Fixed in 02a8c07d89ae2c4643f2bcb78e8c13dd7437e2db, thanks!