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 393 - libsdl-1.2.11 fails to build with yasm-0.5.0
Summary: libsdl-1.2.11 fails to build with yasm-0.5.0
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: 1.2.11
Hardware: x86 Linux
: P1 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-20 08:35 UTC by Pablo De Napoli
Modified: 2007-06-04 04:08 UTC (History)
1 user (show)

See Also:


Attachments
sdl-yasm-sections.patch (3.01 KB, patch)
2007-02-20 22:29 UTC, Mike Frysinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo De Napoli 2007-02-20 08:35:58 UTC
I'm having problems with building libdsl-1.2.11-r1
from the sources
(using Gentoo ebuild)
[also I've tried compiling the sources in svn
by hand, it didn't work either]

./build-scripts/strip_fPIC.sh /usr/bin/yasm -f elf -I ./src/hermes/
-DHIDDEN_VISIBILITY ./src/hermes/mmx_main.asm  -fPIC -DPIC -o
build/.libs/mmx_main.o
/usr/bin/yasm -f elf -I ./src/hermes/ -DHIDDEN_VISIBILITY
./src/hermes/mmx_main.asm -o build/.libs/mmx_main.o
./src/hermes/mmx_main.asm:75: invalid argument to [SECTION]
./src/hermes/mmx_main.asm:75: undefined symbol `.note.GNU' (first use)
./src/hermes/mmx_main.asm:75: undefined symbol `stack' (first use)
./src/hermes/mmx_main.asm:75:  (Each undefined symbol is reported only once.)
make: *** [build/mmx_main.lo] Error 1

The problem is caused by the lines

%ifidn __OUTPUT_FORMAT__,elf
section ".note.GNU-stack" noalloc noexec nowrite progbits
%endif
%ifidn __YASM_OBJFMT__,elf
section ".note.GNU-stack" noalloc noexec nowrite progbits
%endif

at the end of every .asm file
(it seems that there is something that yasm-0.5
does not understand)

The problem is described is also reported by 
someone else in the Gentoo bug tracking system

http://bugs.gentoo.org/show_bug.cgi?id=16305

I'm using binutils-2.16.1 gcc-4.1.2 
yasm-0.5
[however, it compilation did work with yasm-0.4]


This problem is not Gentoo specific, as it is
also reported in

http://www.slacky.it/forum/viewtopic.php?t=17322

by a Slackware user.
Comment 1 Ryan C. Gordon 2007-02-20 15:51:56 UTC
Adding Mike Frysinger to the CC list for this bug, since he's our resident Gentoo ninja (and possibly wrote the yasm code in SDL, too.)

This was on an x86, right? (maybe amd64?)

--ryan.
Comment 2 Pablo De Napoli 2007-02-20 21:45:50 UTC
yes, it is on an x86 (AMD athlon) machine
Comment 3 Mike Frysinger 2007-02-20 22:03:33 UTC
the problem is that older yasm's did not respect __OUTPUT_FORMAT__ ... i asked yasm guys to output that to be compatible with nasm and they did, but then we hit the problem where nasm accepts things like dots and dashes in the section name without being quoted but yasm does not

upstream yasm has fixed this for their next version, but for 0.5.0 the syntax has to be:
.section ".note.GNU-stack" ...

i could tweak the test in configure.in so that if yasm is found but it fails to compile this:
%ifidn __OUTPUT_FORMAT__,elf
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
we fall back to using nasm
Comment 4 Mike Frysinger 2007-02-20 22:29:33 UTC
Created attachment 192 [details]
sdl-yasm-sections.patch

this should do it nicely i think
Comment 5 Ryan C. Gordon 2007-06-02 13:59:00 UTC
Bumping a bunch of bugs to Priority 1 for consideration for the 1.2.12 release.

--ryan.

Comment 6 Ryan C. Gordon 2007-06-04 04:08:57 UTC
Fixed in svn revision #3043 for the 1.2 branch and #3044 for the 1.3 branch.

Thanks!

--ryan.