[Buildroot] [PATCH 2/2] package/erlang-jiffy: fix build failure due to lack of -fPIC

Giulio Benetti giulio.benetti at benettiengineering.com
Thu Oct 14 21:54:55 UTC 2021


Package erlang-jiffy needs to be linked with -fPIC otherwise it throws
linker error:
```
failed with return code 1 and the following output:
/home/giuliobenetti/br_reproduce/60296a48210e7ffc6bc9fa50ee586441a8957e85/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/9.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: /tmp/jiffy.so.FCaOXC.ltrans1.ltrans.o: relocation R_X86_64_PC32 against symbol `dec_destroy' can not be used when making a shared object;
recompile with -fPIC
```

This is architecture indipendent, so let's add -fPIC flag to LDFLAGS in any
case.

Fixes:
http://autobuild.buildroot.net/results/602/60296a48210e7ffc6bc9fa50ee586441a8957e85/

Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
---
 package/erlang-jiffy/erlang-jiffy.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/erlang-jiffy/erlang-jiffy.mk b/package/erlang-jiffy/erlang-jiffy.mk
index cd94632962..25e7227c39 100644
--- a/package/erlang-jiffy/erlang-jiffy.mk
+++ b/package/erlang-jiffy/erlang-jiffy.mk
@@ -11,4 +11,7 @@ ERLANG_JIFFY_LICENSE = MIT (core), \
 	BSD-3-Clause (tests)
 ERLANG_JIFFY_LICENSE_FILES = LICENSE
 
+# erlang-jiffy needs -fPIC to link succesfully
+ERLANG_JIFFY_REBAR_ENV += LDFLAGS="-fPIC"
+
 $(eval $(rebar-package))
-- 
2.25.1



More information about the buildroot mailing list