We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1111 - Fix build with the Clang compiler
Summary: Fix build with the Clang compiler
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.14
Hardware: x86 FreeBSD
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-30 06:28 UTC by kwm
Modified: 2011-01-30 13:42 UTC (History)
0 users

See Also:


Attachments
Build fix with clang. (679 bytes, application/octet-stream)
2011-01-30 06:28 UTC, kwm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kwm 2011-01-30 06:28:27 UTC
Created attachment 562 [details]
Build fix with clang.

When building sdl 1.2.14 with the Clang compiler http://clang.llvm.org .
The build fails in src/video/mmx.h with the following error:

--------------------------------------------------
./src/video/SDL_RLEaccel.c:831:5: error: invalid operand for instruction
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
    ^
./src/video/SDL_RLEaccel.c:831:17: note: instantiated from:
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
                ^
./src/video/SDL_RLEaccel.c:831:5: note: instantiated from:
    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
    ^
./src/video/SDL_RLEaccel.c:647:23: note: instantiated from:
                                blitter(2, Uint8, ALPHA_BLIT16_565MMX); \
                                                  ^
./src/video/SDL_RLEaccel.c:282:4: note: instantiated from:
          movq_r2m(mm3, *dstp);                         \
          ^
In file included from ./src/video/SDL_RLEaccel.c:99:
./src/video/mmx.h:379:28: note: instantiated from:
#define movq_r2m(reg, var)      mmx_r2m(movq, reg, var)
                                ^
<scratch space>:192:1: note: instantiated from:
"movq"
^
<inline asm>:1:2: note: instantiated into assembly here
        movq %mm3, %dx
        ^
--------------------------------------------------

According to the clang developers this is a invalid inline assembly.
Using the attached patch from the last commit in the below bug report fixes the compile.
More details from: http://llvm.org/bugs/show_bug.cgi?id=6730
Comment 1 Sam Lantinga 2011-01-30 13:42:41 UTC
This is fixed, thanks!
http://hg.libsdl.org/SDL/rev/32f0f603a0c8