Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 448714 - games-fps/warsow-1.02 fails to compile with clang-3.2
Summary: games-fps/warsow-1.02 fails to compile with clang-3.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords: Bug
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2012-12-26 22:52 UTC by Julian Ospald
Modified: 2013-11-09 12:44 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
warsow-1.02:20121226-224928.log (warsow-1.02:20121226-224928.log,97.79 KB, text/plain)
2012-12-26 22:52 UTC, Julian Ospald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ospald 2012-12-26 22:52:10 UTC
Created attachment 333402 [details]
warsow-1.02:20121226-224928.log

this is a pity :D

# clang --version
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-pc-linux-gnu
Thread model: posix

clang flags:
CFLAGS="-march=core2 -O3"
CXXFLAGS="${CFLAGS}"
Comment 1 Richard Yao (RETIRED) gentoo-dev 2012-12-27 04:12:13 UTC
The issue here involves the use of the following construction:

>#ifdef __cplusplus
>extern "C" {
>#endif
>
>// Code here
>
>#ifdef __cplusplus
>}
>#endif

Section 7.5 of the C++ specification talks about external linkage as having an effect on the preprocessed source with no mention of any effect on the CPP. Some testing reveals that the use of extern "C" has no effect on Clang's CPP while GCC's CPP will unset __cplusplus inside of it.

LLVM bug #13745 has a minimal test case that exhibits this failure when building a Hello World program that includes math.h with -ffast-math. I have notified upstream about this issue in that bug. I expect them to implement this extension in Clang. In the mean time, it would be possible to workaround this bug by disabling -ffast-math when building with Clang.
Comment 2 Julian Ospald 2012-12-27 14:18:25 UTC
cool, that's a step forward

next error is:

clang++ -I. -I/usr/local/include -I/usr/X11R6/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wall -Wno-unused-function -fvisibility=hidden -fno-strict-aliasing  -funroll-loops -DNDEBUG  -march=core2 -O3 -c ui/as/as_bind_options.cpp -o buildx86_64/ui/as_bind_options.o -DPIC -fPIC -DSTATIC_LIB -I../libsrcs/libRocket/libRocket/Include -I../libsrcs/angelscript/angelSVN/sdk/angelscript/include/ -Iui
In file included from ui/as/as_bind_window.cpp:26:
In file included from ui/as/asui_local.h:17:
ui/as/asbind.h:248:17: error: 'A' declared as an array with a negative size
  static char A[N];
                ^
ui/as/asbind.h:271:48: note: in instantiation of template class
      'ASBind::ctassert<false>' requested here
  ...T> const char * typestr() { ctassert<false>(); return "ERROR"; }
                                 ^
1 error generated.
make: *** [buildx86_64/ui/as_bind_window.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ui/as/as_bind_options.cpp:6:
In file included from ui/as/asui_local.h:17:
ui/as/asbind.h:248:17: error: 'A' declared as an array with a negative size
  static char A[N];
                ^
ui/as/asbind.h:271:48: note: in instantiation of template class
      'ASBind::ctassert<false>' requested here
  ...T> const char * typestr() { ctassert<false>(); return "ERROR"; }
                                 ^
1 error generated.
make: *** [buildx86_64/ui/as_bind_options.o] Error 1
Comment 3 Ray Griffin (rorgoroth) 2013-10-12 11:31:17 UTC
(In reply to Julian Ospald (hasufell) from comment #2)
I reported this to upstream via github before coming across this due to installing warsow locally rather then from portage, that build failure has just been fixed here: https://github.com/viciious/qfusion/commit/c63672c41a

Tested using clang 3.3 w/ git and 1.0.3 SDK source.
Comment 4 Julian Ospald 2013-11-09 12:44:52 UTC
+*warsow-1.03 (09 Nov 2013)
+
+  09 Nov 2013; Julian Ospald <hasufell@gentoo.org> +warsow-1.03.ebuild,
+  +files/warsow-1.03-build.patch, +files/01-warsow-1.03-clang.patch,
+  +files/02-warsow-1.03-clang.patch, +files/03-warsow-1.03-clang.patch,
+  +files/warsow-1.03-pic.patch:
+  version bump and fix build with clang wrt #448714