Bug 10521

Summary: Fail to build systemtap-native
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Yi Zhao <yi.zhao>
Component: coreAssignee: Ross Burton <ross.burton>
Status: VERIFIED FIXED QA Contact: Yi Zhao <yi.zhao>
Severity: normal    
Priority: Medium CC: jku, jose.perez.carranza, meta.mr.watcher, meta.watcher, yi.zhao
Version: 2.2   
Target Milestone: 2.3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
log.do_compile
none
log.do_configure
none
log.do_compile none

Description Yi Zhao 2016-10-28 09:48:14 UTC
Created attachment 3511 [details]
log.do_compile

Git rev: morty/dc8508f609974cc99606b9042bfa7f870ce80228

Host: Ubuntu 16.04/14.04 x86-64

Steps:
bitbake systemtap-native

The systemtap-native failed to build with following error:

##############################
[snip]
gcc  -Wall -Wextra -Werror -Wunused -W -Wformat=2 -L/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/usr/lib -ljson-c -L/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/usr/lib -lncurses -ltinfo -isystem/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -fstack-protector-all -D_FORTIFY_SOURCE=2  -L/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/usr/lib -L/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/lib -Wl,-rpath-link,/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/lib -Wl,-rpath,/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/buildarea1/poky/build-systemtap/tmp/sysroots/x86_64-linux/lib -Wl,-O1 -o stapio stapio.o mainloop.o common.o ctl.o relay.o relay_old.o monitor.o libstrfloctime.a -lpthread
monitor.o: In function `comp_name':
monitor.c:(.text+0x26): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0x38): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0x42): undefined reference to `json_object_get_string'
monitor.c:(.text+0x4f): undefined reference to `json_object_get_string'
monitor.o: In function `comp_state':
monitor.c:(.text+0xa6): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0xb8): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0xc2): undefined reference to `json_object_get_string'
monitor.c:(.text+0xcf): undefined reference to `json_object_get_string'
monitor.o: In function `comp_max':
monitor.c:(.text+0x126): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0x138): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0x142): undefined reference to `json_object_get_int'
monitor.c:(.text+0x14e): undefined reference to `json_object_get_int'
monitor.o: In function `comp_avg':
monitor.c:(.text+0x1a6): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0x1b8): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0x1c2): undefined reference to `json_object_get_int'
monitor.c:(.text+0x1ce): undefined reference to `json_object_get_int'
monitor.o: In function `comp_min':
monitor.c:(.text+0x226): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0x238): undefined reference to `json_object_object_get_ex'
monitor.c:(.text+0x242): undefined reference to `json_object_get_int'
monitor.c:(.text+0x24e): undefined reference to `json_object_get_int'
[snip]
###############################

For the details, please see the attached log
Comment 1 Jussi Kukkonen 2016-11-03 08:29:14 UTC
Are you using gold linker or have any other linker related differences on your system?
Comment 2 Ross Burton 2016-11-03 14:57:14 UTC
oe-core fb9dc1cf7a2d6d5e22beb68f17b4c9c8d1136e37 fixed the dependencies so that json-c is a build dependency, and should have solved anything like this.

Can you verify that you have this commit, and if you can replicate please also provide log.do_configure.
Comment 3 Yi Zhao 2016-11-07 04:57:21 UTC
Created attachment 3527 [details]
log.do_configure
Comment 4 Yi Zhao 2016-11-07 04:57:53 UTC
Created attachment 3528 [details]
log.do_compile
Comment 5 Yi Zhao 2016-11-07 04:59:37 UTC
(In reply to comment #2)
> oe-core fb9dc1cf7a2d6d5e22beb68f17b4c9c8d1136e37 fixed the dependencies so
> that json-c is a build dependency, and should have solved anything like this.
> 
> Can you verify that you have this commit, and if you can replicate please
> also provide log.do_configure.

(In reply to comment #2)
> oe-core fb9dc1cf7a2d6d5e22beb68f17b4c9c8d1136e37 fixed the dependencies so
> that json-c is a build dependency, and should have solved anything like this.
> 
> Can you verify that you have this commit, and if you can replicate please
> also provide log.do_configure.

I still can reproduced it with latest master branch: 1655d55764eb0241b71217810500fcf1d4519a1c

The log.do_configure and log.do_compile are attached.
Comment 6 Ross Burton 2016-11-08 17:23:27 UTC
Do you have jsonc installed on your build host?
Comment 7 Ross Burton 2016-11-08 17:46:25 UTC
Oh it's not just json, but also ncurses.
Comment 8 Ross Burton 2016-11-08 17:56:51 UTC
Ah, ubuntu.  I bet it's their toolchain hardening breaking it (as they enforce --as-needed).
Comment 9 Ross Burton 2016-11-09 00:11:32 UTC
Yes, systemtap link order was broken and the latest ubuntu was being even more strict about it.  Patch on the list.
Comment 10 Ross Burton 2016-11-30 17:10:04 UTC
Fixed in oe-core 5ca6ac8739ea4a273df7b8e5c5f7d481619923d8.
Comment 11 Yi Zhao 2016-12-23 01:34:28 UTC
Verified with 2.3 M1 RC1 build
git rev: master/573c646d4cc62dcd0c230381df4940bdf314d495