add -ljson-c to automake to allow fwts to build with json-c v 0.11 [PATCH]

Bug #1268005 reported by Mike Gahagan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Firmware Test Suite
Fix Released
Medium
Colin Ian King

Bug Description

Building fwts against newer json-c libraries fails because the linker cannot find json-c due to a change introduced in json-c version 0.11. Build fails during linking phase as seen below:

make[3]: Entering directory `/tmp/fwts-test/new/fwts/src'
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -ljson -lm -o fwts main.o ac_adapter.o acpidump.o acpiinfo.o acpitables.o apicinstance.o battery.o brightness-helper.o brightness.o autobrightness.o checksum.o crsdump.o prsdump.o cstates.o dmar.o fadt.o fan.o lid.o mcfg.o method.o osilinux.o pcc.o powerbutton.o s3.o s3power.o s4.o syntaxcheck.o wakealarm.o wmi.o apicedge.o bios_info.o bios32.o ebda_region.o ebdadump.o hdaaudio.o memmapdump.o mtrr.o mpcheck.o mpdump.o os2gap.o pciirq.o pnp.o romdump.o cmosdump.o virt.o virt_svm.o virt_vmx.o maxfreq.o cpufreq.o nx.o msr.o microcode.o dmicheck.o hotkey.o hpet_check.o klog.o oops.o version.o aspm.o crs.o maxreadreq.o csm.o uefidump.o uefirttime.o uefirtvariable.o uefirtmisc.o securebootcert.o uefivarinfo.o -Llib/src -lfwts -L../src/acpica -lfwtsacpica
libtool: link: gcc -g -O2 -o .libs/fwts main.o ac_adapter.o acpidump.o acpiinfo.o acpitables.o apicinstance.o battery.o brightness-helper.o brightness.o autobrightness.o checksum.o crsdump.o prsdump.o cstates.o dmar.o fadt.o fan.o lid.o mcfg.o method.o osilinux.o pcc.o powerbutton.o s3.o s3power.o s4.o syntaxcheck.o wakealarm.o wmi.o apicedge.o bios_info.o bios32.o ebda_region.o ebdadump.o hdaaudio.o memmapdump.o mtrr.o mpcheck.o mpdump.o os2gap.o pciirq.o pnp.o romdump.o cmosdump.o virt.o virt_svm.o virt_vmx.o maxfreq.o cpufreq.o nx.o msr.o microcode.o dmicheck.o hotkey.o hpet_check.o klog.o oops.o version.o aspm.o crs.o maxreadreq.o csm.o uefidump.o uefirttime.o uefirtvariable.o uefirtmisc.o securebootcert.o uefivarinfo.o -Llib/src -L../../../src/acpica/source/compiler -L../src/acpica /tmp/fwts-test/new/fwts/src/acpica/.libs/libfwtsacpica.so -L../../src/lib/src /tmp/fwts-test/new/fwts/src/lib/src/.libs/libfwts.so -lm -lpcre -ljson /tmp/fwts-test/new/fwts/src/acpica/source/compiler/.libs/libfwtsiasl.so -lpthread -lrt -Wl,-rpath -Wl,/usr/local/lib/fwts
/usr/bin/ld: syntaxcheck.o: undefined reference to symbol 'json_object_array_get_idx'
/usr/bin/ld: note: 'json_object_array_get_idx' is defined in DSO /lib64/libjson-c.so.2 so try adding it to the linker command line
/lib64/libjson-c.so.2: could not read symbols: Invalid operation

Adding -ljson-c to LDFLAGS for fwts, libfwts_la, and kernelscan fixes the issue. I have tested the fix with the V13.12.00 as well as current git (commit: b98b1b1915a921855a3c52cba9f23ec24f9e75de - Jan 3, 2014) I have not however tried it on an Ubuntu release as of yet.

Revision history for this message
Mike Gahagan (mgahagan) wrote :
Revision history for this message
Colin Ian King (colin-king) wrote :

Thanks Mike, we'll sort that out next week.

Revision history for this message
Colin Ian King (colin-king) wrote :

Patch sent to fwts-devel mailing list for review and inclusion to the next release: https://lists.ubuntu.com/archives/fwts-devel/2014-January/004279.html

Changed in fwts:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Colin King (colin-king)
Changed in fwts:
milestone: none → 14.02.00
Revision history for this message
Colin Ian King (colin-king) wrote :

A more backwardly compatible version posted for review: https://lists.ubuntu.com/archives/fwts-devel/2014-January/004328.html

Alex Hung (alexhung)
Changed in fwts:
status: In Progress → Fix Committed
Changed in fwts:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.