View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004239 | unreal | installing | public | 2013-10-03 08:31 | 2014-07-06 16:01 |
Reporter | QIXOZL | Assigned To | tmcarthur | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | x86 | OS | FreeBSD | OS Version | 9.2 |
Product Version | 3.2.10.1 | ||||
Fixed in Version | 3.2.10.4 | ||||
Summary | 0004239: Undefined symbols in modules with clang | ||||
Description | FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 Target: x86_64-unknown-freebsd9.2 compilations goes through however the modules seem to have undefined symbols. for example: * unrealircd.conf:3: loadmodule src/modules/commands.so: failed to load: tmp/4C5068E0.commands.so: Undefined symbol "me" * unrealircd.conf:4: loadmodule src/modules/cloak.so: failed to load: tmp/4633C79D.cloak.so: Undefined symbol "iConf" | ||||
Steps To Reproduce | compiled using: ./configure --with-showlistmodes --enable-ssl --enable-ziplinks --with-listen=5 --with-dpath=/root/Unreal3.2.10.1 --with-spath=/root/Unreal3.2.10.1/src/ircd --with-nick-history=250 --with-sendq=3000000 --with-bufferpool=18 --with-permissions=0600 --with-fd-setsize=1024 --enable-dynamic-linking | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
3rd party modules | |||||
|
The issue looks to lie with the fact that Clang/LLVM uses the C99 standard by default, but UnrealIRCd contains code (namely functions declared as 'inline' in this case) that rely on the compiler using the GNU89 standard. I've attached a couple of patches that cause the -std=gnu89 option to be explicitly passed to the compiler and also explicitly specify that the -export-dynamic option should be passed to the linker. |
|
thanks that seems to work |
|
would this patch disable any C99 features? granted, we use very few.. 'like checking if C99 variable length arrays are supported' to name one. |
|
It does look like, in the case of C99 variable length array support, that the patch does disable C99 features. From the configure output: checking if C99 variable length arrays are supported... no |
|
I've updated the category & severity. binki: I heard you were maybe looking into this? let me know what you think.. |
|
This needs to be fixed in 3.2.10.3. binki? :P (e-mail notification was not working before) |
|
Just noticed this hasn't been fixed in 3.2.10.3 because there hasn't been any movement on this bug. Pitty.. sorry. |
|
Can someone point me in the direction of what I can do with the attached files(configure.patch and/or configure.ac.patch) so that I can get the modules to compile correctly under FreeBSD? |
|
Both of these patches were recently committed to the FreeBSD ports tree in lieu of this bug being fixed. See http://svnweb.freebsd.org/ports?view=revision&revision=355584 |
|
This will also impact other *BSD variants including Mac OS X. We probably should fix it for 3.4 if not 3.2 |
|
I did figure out the changes described in the two files (configure.patch and configure.ac.patch), I then ran ./Config again and completed a make. But the undefined symbols issue persisted. I look forward to when this bug is resolved. |
|
worked fine for me on freebsd 9.x. which os did you try it on? |
|
I'm running FreeBSD 10.0-RELEASE #0 r260789. |
|
I ran through the install process again. Upon reviewing my previous actions, I was patching Unreal3.2.10 and getting the same error with the modules having undefined symbols. Upon switching back to the 3.2.10.3 release and applying the changes in both of the patch files, the undefined symbol error was resolved. I have moved on to the next error in my config file. Thank you for your assistance. |
|
tmcarthur, you looking into this? I don't want to force the compiler to use C89 for everyone, and preferably for nobody :p. I've no FreeBSD box so I can't check. rfrederick says it's due to inline, but in the report I read unresolved symbols for variables like me and iConf. Part of the patch uses a different method to pass -export-dynamic to the linker, does that fix most of the issues? After fixing that how many errors are still left? For 3.4.x we should fix export-dynamic if it isn't passed on correctly (didn't verify), and don't force C89 but rather fix the code if possible. For 3.2.x it depends on how invasive the code change are, otherwise simply force C89 if using clang (only!). Thanks! I'll put out a 3.2.10.4 if this is fixed. |
|
syzop if you need a shell account on a FreeBSD 10.0-RELEASE machine to fix this, feel free to contact me |
|
jeez setting up a vm takes how long? 10 minutes? 15? :-P not to mention that a unix developer should have at least one bsd at hand anyway. as for the actual matter, this problem is caused by relying on gcc/gnu specific stuff which of course always is a bad idea. details and several solutions can be found there: http://clang.llvm.org/compatibility.html#inline |
|
syszop, yeah, this is my priority now that the modes are modularized, I'll test on FreeBSD and OS X, both of which rely on clang - I use clang for the most part at my day job, so I'm pretty familiar with it. Thanks, Travis |
|
Passing -Wl for export-dynamic seems to correct problem on FreeBSD 10 and OS X 10.9, so will commit that and close - the warnings for inlines I'm not super concerned about at this point - we have numerous other errors under clang (and gcc) due to how we do some of our hook function pointers that we probably want to correct at some time (though not a high priority). |
|
Oh wait - did find one additional issue - correcting then committing my mistake :P |
|
Done - will do additional testing when we release alpha, but quick smoke testing shows this appears fixed on 3.4 for OS X and FreeBSD. |
|
Backported to 3.2.x (untested). http://hg.unrealircd.com/hg/unreal/rev/1070c09c1dc2 Changelog: Fix compile errors when building with clang instead of gcc, which is more and more becoming the default nowadays such as on FreeBSD. Reported by QIXOZL (0004239). Backported the patch from Heero. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-10-03 08:31 | QIXOZL | New Issue | |
2013-11-21 21:18 | rfrederick | File Added: configure.patch | |
2013-11-21 21:18 | rfrederick | File Added: configure.ac.patch | |
2013-11-21 21:25 | rfrederick | Note Added: 0017842 | |
2013-11-23 23:09 | QIXOZL | Note Added: 0017845 | |
2014-01-12 10:24 | syzop | Note Added: 0017871 | |
2014-01-12 10:24 | syzop | Note Edited: 0017871 | |
2014-01-12 11:22 | syzop | Severity | minor => major |
2014-01-12 18:01 | rfrederick | Note Added: 0017890 | |
2014-03-14 01:14 | peterkingalexander | Issue cloned: 0004262 | |
2014-04-14 21:02 | syzop | Note Added: 0018134 | |
2014-04-14 21:02 | syzop | Severity | major => block |
2014-04-14 21:02 | syzop | Category | module => installing |
2014-04-14 21:02 | syzop | Status | new => confirmed |
2014-04-20 10:26 | syzop | Note Added: 0018136 | |
2014-05-31 22:01 | syzop | Note Added: 0018154 | |
2014-06-03 21:47 | rcnewman3 | Note Added: 0018170 | |
2014-06-03 21:51 | rfrederick | Note Added: 0018171 | |
2014-06-05 16:59 | tmcarthur | Note Added: 0018181 | |
2014-06-05 18:29 | rcnewman3 | Note Added: 0018185 | |
2014-06-05 23:18 | QIXOZL | Note Added: 0018186 | |
2014-06-05 23:24 | rcnewman3 | Note Added: 0018187 | |
2014-06-06 07:02 | tmcarthur | Assigned To | => tmcarthur |
2014-06-06 07:02 | tmcarthur | Status | confirmed => assigned |
2014-06-06 16:54 | rcnewman3 | Note Added: 0018188 | |
2014-06-08 10:28 | syzop | Note Added: 0018189 | |
2014-06-08 10:31 | syzop | Note Edited: 0018189 | |
2014-06-18 13:04 | Klintrup | Note Added: 0018199 | |
2014-06-28 06:08 | QIXOZL | Note Added: 0018204 | |
2014-07-05 18:35 | tmcarthur | Note Added: 0018207 | |
2014-07-05 20:53 | tmcarthur | Note Added: 0018208 | |
2014-07-05 20:57 | tmcarthur | Note Added: 0018209 | |
2014-07-05 22:17 | tmcarthur | Note Added: 0018210 | |
2014-07-05 22:17 | tmcarthur | Status | assigned => resolved |
2014-07-05 22:17 | tmcarthur | Fixed in Version | => 3.4-alpha1 |
2014-07-05 22:17 | tmcarthur | Resolution | open => fixed |
2014-07-06 16:01 | syzop | Note Added: 0018211 | |
2014-07-06 16:01 | syzop | Fixed in Version | 3.4-alpha1 => 3.2.10.4 |