Bug 10026 - [PATCH] lua-5.3.4: fix lua linker error in swupdate
Summary: [PATCH] lua-5.3.4: fix lua linker error in swupdate
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-11 11:28 UTC by Stefan Becker
Modified: 2017-08-11 13:58 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
add missing -ldl to lua.pc (361 bytes, patch)
2017-07-11 11:28 UTC, Stefan Becker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Becker 2017-07-11 11:28:50 UTC
Created attachment 7101 [details]
add missing -ldl to lua.pc

When I updated my existing buildroot configuration to 2017.05 or newer I get build errors in the package "swupdate":

  Trying libraries: pthread lua m z ubootenv
  Failed: -Wl,--start-group -lpthread -llua -lm -lz -lubootenv -Wl,--end-group
  ...
  ==========
  .../output/host/arm-buildroot-linux-gnueabihf/sysroot/lib/liblua.so: undefined reference to `dlopen'
  .../output/host/arm-buildroot-linux-gnueabihf/sysroot/lib/liblua.so: undefined reference to `dlclose'
  .../output/host/arm-buildroot-linux-gnueabihf/sysroot/lib/liblua.so: undefined reference to `dlerror'
  .../output/host/arm-buildroot-linux-gnueabihf/sysroot/lib/liblua.so: undefined reference to `dlsym'
  collect2: error: ld returned 1 exit status
  make[1]: *** [swupdate_unstripped] Error 1

The root cause is a missing "-ldl" in etc/lua.pc.

This is probably wrong for all lua patches that add etc/lua.pc, although I personally only tested lua-5.3.4. The patch should apply to them too.

I'm attaching the patch that I added to my buildroot external directory to fix the build problem.