View Issue Details

IDProjectCategoryView StatusLast Update
0004777unrealinstallingpublic2016-11-14 11:16
ReporterrfrederickAssigned Tosyzop 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSFreeBSDOS Version10.3
Product Version4.0.8 
Target VersionFixed in Version4.0.8.1 
Summary0004777: UnrealIRCd 4.0.8 Fails to Build with Clang/LLVM on FreeBSD 10.3
DescriptionUnrealIRCd 4.0.8 fails to build with Clang/LLVM on FreeBSD 10.3 with the following build error:

===

cc -I/home/rfrederick/unrealircd-4.0.8/include -D_THREAD_SAFE -pthread -I/home/rfrederick/unrealircd-4.0.8/extras/regexp/include -I/home/rfrederick/unrealircd-4.0.8/extras/pcre2/include -I/usr/local/include -pipe -g -O2 -funsigned-char -Wl,-export-dynamic -fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -lssl -lcrypto -o ircd timesynch.o res.o s_bsd.o auth.o aln.o channel.o cloak.o crule.o dbuf.o events.o fdlist.o hash.o ircd.o ircsprintf.o list.o match.o modules.o packet.o parse.o s_auth.o mempool.o operclass.o s_conf.o s_debug.o s_dispatch.o s_err.o s_extra.o s_kline.o s_misc.o s_numeric.o s_serv.o s_svs.o socket.o ssl.o s_user.o charsys.o scache.o send.o support.o umodes.o version.o whowas.o random.o extcmodes.o moddata.o uid.o extbans.o api-isupport.o api-command.o api-clicap.o md5.o crypt_blowfish.o updconf.o crashreport.o -Wl,-rpath=/home/rfrederick/unrealircd/lib -pie -Wl,-z,relro -Wl,-z,now -lcrypt -L/home/rfrederick/unrealircd/lib -ltre -L/home/rfrederick/unrealircd/lib -lpcre2-8 -L/usr/local/lib -lcares -lssl -lcrypto
/usr/bin/ld: /home/rfrederick/unrealircd/lib/libtre.a(tre-compile.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/home/rfrederick/unrealircd/lib/libtre.a: could not read symbols: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [Makefile:67: ircd] Error 1
gmake[1]: Leaving directory '/usr/home/rfrederick/unrealircd-4.0.8/src'
gmake: *** [Makefile:141: build] Error 2

===

Building with GCC is successful.
Steps To ReproduceAttempt building and installing UnrealIRCd 4.0.8 on a FreeBSD 10.3 system without GCC installed.
Tagsbulding, clang, freebsd
3rd party modules

Activities

syzop

2016-11-14 08:30

administrator   ~0019510

Will check it out

syzop

2016-11-14 09:46

administrator   ~0019511

Just installed FreeBSD and I can confirm UnrealIRCd does not build on 10.3 with clang (and without gcc). The error itself is slightly different but probably same cause.

syzop

2016-11-14 09:55

administrator   ~0019512

Last edited: 2016-11-14 09:55

View 2 revisions

Looks like TRE is being built statically. c-ares and pcre2 are being built correctly (dynamically).

syzop

2016-11-14 10:02

administrator   ~0019513

configure:13001: checking whether the cc linker (/usr/bin/ld) supports shared libraries
configure:13982: result: yes
configure:14003: checking whether -lc should be explicitly linked in
configure:14008: cc -c -g -O2 -Wall  conftest.c >&5
configure:14011: $? = 0
configure:14026: cc -shared conftest.o  -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| grep  -lc  \>/dev/null 2
configure:14029: $? = 0
configure:14041: result: no
configure:14049: checking dynamic linker characteristics
configure:14663: result: no
configure:14687: checking how to hardcode library paths into programs
configure:14712: result: immediate
configure:14726: checking whether stripping libraries is possible
configure:14731: result: yes
configure:15533: checking if libtool supports shared libraries
configure:15535: result: no <=============================================================
configure:15538: checking whether to build shared libraries
configure:15559: result: no
configure:15562: checking whether to build static libraries
configure:15566: result: yes
configure:15660: creating libtool
configure:16293: creating ./config.status

syzop

2016-11-14 10:26

administrator   ~0019514

The problem is in the TRE library.
There's no newer version available than we ship. They are still at 0.8.0 from 2009.

They do have a repository at github. But after cloning, you need to run a few commands to make the version usable + package as .tar.gz... this isn't working or at least not producing a working ./configure for all systems.
Hmmmmm.

syzop

2016-11-14 10:50

administrator   ~0019515

Update TRE to git version because of FreeBSD build problems with clang

https://github.com/unrealircd/unrealircd/commit/00ad832a59757b8fa6113ca8bd33338963995d0e

I'll release 4.0.8.1 later today/tomorrow which contains this fix.

syzop

2016-11-14 11:16

administrator   ~0019516

I have released 4.0.8.1. It's available from the main site.

Issue History

Date Modified Username Field Change
2016-11-14 05:46 rfrederick New Issue
2016-11-14 05:46 rfrederick Tag Attached: freebsd clang building
2016-11-14 05:54 rfrederick Tag Detached: freebsd clang building
2016-11-14 05:54 rfrederick Tag Attached: bulding
2016-11-14 05:54 rfrederick Tag Attached: clang
2016-11-14 05:54 rfrederick Tag Attached: freebsd
2016-11-14 08:30 syzop Assigned To => syzop
2016-11-14 08:30 syzop Status new => acknowledged
2016-11-14 08:30 syzop Note Added: 0019510
2016-11-14 09:46 syzop Status acknowledged => confirmed
2016-11-14 09:46 syzop Note Added: 0019511
2016-11-14 09:55 syzop Note Added: 0019512
2016-11-14 09:55 syzop Note Edited: 0019512 View Revisions
2016-11-14 10:02 syzop Note Added: 0019513
2016-11-14 10:26 syzop Note Added: 0019514
2016-11-14 10:50 syzop Status confirmed => resolved
2016-11-14 10:50 syzop Resolution open => fixed
2016-11-14 10:50 syzop Fixed in Version => 4.0.8.1
2016-11-14 10:50 syzop Note Added: 0019515
2016-11-14 11:16 syzop Note Added: 0019516