Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237600 - media-libs/audiofile - compile fails in mingw32 crosscompile due to patch
Summary: media-libs/audiofile - compile fails in mingw32 crosscompile due to patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-14 01:48 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2008-10-27 05:04 UTC (History)
2 users (show)

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


Attachments
Allows crosscompiling audiofile using mingw32, replaces audiofile-largefile.patch (audiofile-largefile.patch,721 bytes, patch)
2008-09-14 01:52 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2008-09-14 01:48:39 UTC
This is probably unsupported, but I was used crossdev to create a mingw32 cross-compiler. I then tried to emerge libsdl into its SYSROOT (/usr/mingw32). The compile failed because a line that looks like this in one of media-libs/audiofile-0.2.6-r3's headers:
typedef int64_t AFframecount;
caused an error. This error was caused because int64_t was not defined.

I found that the source of this line of code was a Gentoo patch to audiofile named audiofile-largefile.patch. I also found that MinGW's w32api/mingw-runtime/gcc does not cause int64_t to be defined when #include <sys/types.h> is included. I think audiofile-largefile.patch should be modified to #include <stdint.h> which does define int64_t.

Reproducible: Always

Steps to Reproduce:
1. Somehow get a mingw32 crosscompiler set up using crossdev --target mingw32
2. Try to compile libsdl into the sysroot after setting up /usr/mingw32/{make.profile,make.conf,make.globals} with this command:
OOT=/usr/mingw32/ PORTAGE_CONFIGROOT=/usr/mingw32 CBUILD=x86_64-pc-linux-gnu CHOST=mingw32 emerge -v libsdl
3. find out there is an error :-)

Actual Results:  
Errors from gcc:
config.status: executing default commands
make  all-recursive
make[1]: Entering directory `/var/tmp/portage/media-libs/audiofile-0.2.6-r3/work/audiofile-0.2.6'
Making all in libaudiofile
make[2]: Entering directory `/var/tmp/portage/media-libs/audiofile-0.2.6-r3/work/audiofile-0.2.6/libaudiofile'
Making all in modules
make[3]: Entering directory `/var/tmp/portage/media-libs/audiofile-0.2.6-r3/work/audiofile-0.2.6/libaudiofile/modules'
source='g711.c' object='g711.lo' libtool=yes \
	depfile='.deps/g711.Plo' tmpdepfile='.deps/g711.TPlo' \
	depmode=gcc3 /bin/sh ../../depcomp \
	/bin/sh ../../libtool --mode=compile mingw32-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I./..   -DNDEBUG -Os -pipe -c -o g711.lo `test -f g711.c || echo './'`g711.c
mkdir .libs
mingw32-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I./.. -DNDEBUG -Os -pipe -c g711.c -MT g711.lo -MD -MP -MF .deps/g711.TPlo  -DDLL_EXPORT -DPIC -o .libs/g711.lo
In file included from g711.c:33:
./../audiofile.h:48: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'AFframecount'
./../audiofile.h:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'AFfileoffset'
==snipped out unimportant errors (that are caused by these two errors)==

Expected Results:  
I expected audiofile to compile correctly. In fact, it does with the (hopefully) attached replacement for audiofile-large.patch (which makes audiofile.h #include <stdint.h>).

I'm pretty sure this makes no difference: the arch I'm compiling from is amd64.
Comment 1 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2008-09-14 01:52:17 UTC
Created attachment 165367 [details, diff]
Allows crosscompiling audiofile using mingw32, replaces audiofile-largefile.patch

This replaces the patch given in bug #118600 . AFAIK, it preserves the fix to the previous bug. I only tested it on media-libs/audiofile-0.2.6-r3.
Comment 2 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2008-09-14 02:08:12 UTC
Comment on attachment 165367 [details, diff]
Allows crosscompiling audiofile using mingw32, replaces audiofile-largefile.patch

Ooops. I thought I had saved the file. Please ignore these lines in the patch I threw up:
>+//#define AFframecount int64_t
>+//#define AFfileoffset int64_t
Comment 3 SpanKY gentoo-dev 2008-10-27 05:04:51 UTC
looks good, thanks ... note, this isnt really mingw32 specific ...

http://sources.gentoo.org/media-libs/audiofile/files/audiofile-largefile.patch?r1=1.1&r2=1.2