Summary: | net-im/ejabberd: Build fails with "/usr/bin/ld: unrecognized option '-plugin'" | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Bernhard <bernhard.kneip> | ||||
Component: | Individual Port(s) | Assignee: | Ashish SHUKLA <ashish> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | dewayne | ||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(ashish) |
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Bernhard
2020-04-07 18:11:40 UTC
Can you remove the link-time optimisation? (-flto) FYI: I successfully built ejabberd on both i386 and amd64 on 27th March. (In reply to dewayne from comment #1) Indeed the problem seems to be their custom compiler/linker flags. Thanks for noticing it. (In reply to Bernhard from comment #0) Could you please share the output of: make -C /basejail/usr/ports/net-im/ejabberd -V CFLAGS -V CXXFLAGS -V LDFLAGS Thanks! Thanks for responding so quickly! root@jabber-1:~ # make -C /basejail/usr/ports/net-im/ejabberd -V CFLAGS -V CXXFLAGS -V LDFLAGS -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -L/usr/local/lib -Wl,-rpath,/usr/local/lib -fstack-protector-strong (In reply to Bernhard from comment #3) Thanks, I'm also able to reproduce it on a friend's 11.x host. Created attachment 213191 [details]
Probable fix
Could you give this attached diff a try, and see if it works for you ?
Thanks!
I can confirm, that your patch worked me! A commit references this bug: Author: ashish Date: Wed Apr 8 13:14:04 UTC 2020 New revision: 531114 URL: https://svnweb.freebsd.org/changeset/ports/531114 Log: - Fix brokenness on 11.x due to lack of LTO support, required by one of the dependency Thanks to dewayne@heuristicsystems.com.au for pointing out the issue PR: 245428 Reported by: Bernhard <bernhard.kneip@postadigitale.de>, pkg-fallout@ Changes: head/net-im/ejabberd/Makefile Committed, Thanks! (In reply to Ashish SHUKLA from comment #8) Ashish, I'm not quite sure why you restricted the fix to pre 12 systems. I'd just updated my port build and ejabberd failed to build on my 12.1Stable amd64 system. Commenting out the test which enables lto to be removed, and my build succeed :) (In reply to dewayne from comment #9) This is weird. The ld shipped with 12.1-RELEASE (lld 8.0.1) supports -plugin option, and I believe lld 9.0.1 which is shipped with 12.1-STABLE supports it too. Could you provide the output of: % cat >hello.c <<EOF #include <stdio.h> int main() { puts("Hello"); } EOF % cc -v -flto -o hello hello.c I tested on a 12.1-STABLE host and seems to work fine for me. 12.1-STABLE FreeBSD 12.1-STABLE #0 r356856: Sat Jan 18 03:52:01 UTC 2020 Thanks! (In reply to Ashish SHUKLA from comment #10) Thank-you. Yes I get a good result in my base system but not in the jail. Please disregard my suggestion. I think I have a damaged jail. (which is going to take some time to sort out). I appreciate your example. :) # cc -v -flto -o hello hello.c FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b3 15c7dce08fd05) (based on LLVM 9.0.1) Target: x86_64-unknown-freebsd12.1 Thread model: posix InstalledDir: /usr/bin "/usr/bin/cc" -cc1 -triple x86_64-unknown-freebsd12.1 -emit-llvm-bc -flto -flto-unit -disabl e-free -disable-llvm-verifier -discard-value-names -main-file-name hello.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-t ables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resourc e-dir /usr/lib/clang/9.0.1 -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 93 -fobjc-runtime=gnustep -fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o /tmp/hello- 5d5a14.o -x c hello.c clang -cc1 version 9.0.1 based upon LLVM 9.0.1 default target x86_64-unknown-freebsd12.1 #include "..." search starts here: #include <...> search starts here: /usr/lib/clang/9.0.1/include /usr/include End of search list. "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable -new-dtags -o hello /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib -plugin /u sr/bin/../lib/LLVMgold.so -plugin-opt=mcpu=x86-64 /tmp/hello-5d5a14.o -lgcc --as-needed -lgcc _s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crt n.o ./hello Hello |