Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Aug 2010 11:40:03 +0200
From:      =?ISO-8859-1?Q?Ren=E9_Ladan?= <r.c.ladan@gmail.com>
To:        Anonymous <swell.k@gmail.com>
Cc:        stast@bsdportal.ru, freebsd ports <freebsd-ports@freebsd.org>
Subject:   Re: devel/sdl12 and gcc -m32
Message-ID:  <AANLkTi=nAAZFb75O5yOvGmfc=TDR=QvocKrUNyudon0N@mail.gmail.com>
In-Reply-To: <86tymbjfen.fsf@gmail.com>
References:  <AANLkTi=TX_=NkGdVVUKhbNg_oV0BaK580A%2Buxua7nj2Z@mail.gmail.com> <86tymbjfen.fsf@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
(cc'ing submitter of the port)

2010/8/31 Anonymous <swell.k@gmail.com>:
> Ren=E9 Ladan <r.c.ladan@gmail.com> writes:
>
>> Hi,
>>
>> I was trying to build the future port games/avp-demo (ports/138806) on
>> my 9.0-amd64 laptop
>> with system gcc, but this failed because of SDL errors:
>>
>> gcc -m32 -g -Wall -pipe -Isrc -Isrc/include -Isrc/win95 -Isrc/avp
>> -Isrc/avp/win95 -Isrc/avp/support -Isrc/avp/win95/frontend
>> -Isrc/avp/win95/gadgets -I/usr/local/include/SDL -I/usr/local/include
>> -D_GNU_SOURCE=3D1 -D_REENTRANT -I/usr/local/include -c -o src/main.o
>> src/main.c
>> In file included from /usr/local/include/SDL/SDL_main.h:26,
>> from /usr/local/include/SDL/SDL.h:30,
>> from src/main.c:6:
>> /usr/local/include/SDL/SDL_stdinc.h:131: error: size of array
>> 'SDL_dummy_uint64' is negative
>> /usr/local/include/SDL/SDL_stdinc.h:132: error: size of array
>> 'SDL_dummy_sint64' is negative
>
> -m32 is not supported yet, especially not by the ports tree. And even if
> you manage to compile sources it wouldn't link against 64bit libs.
>
Hmm ok, I'll add a NOT_FOR_ARCH / ONLY_FOR_ARCH to the port.

> There is a way to compile 32bit ports on amd64 but it involves either
> using chroot() or different LOCALBASE.

The wine approach.

>
>>
>> Note the -m32 flag passed to gcc, which is used to force generating
>> 32-bit code on 64-bit
>> platforms. The flag is set in the Makefile of the game itself. When I
>> removed the flag I ran into
>> code snippets which would need a rewrite for 64-bit platforms
>> (typecasting, extending hash
>> functions on pointers, etc).
>
> This just means the port is BROKEN on amd64.
>
>> I guess SDL is tellng that I cannot have 64-bit values on a 32-bit
>> target when I have devel/sdl12
>> compiled as the native 64-bit version. Is this a limitation of SDL itsel=
f?
>
> I guess SDL inherits some values from <machine/*.h> headers.
>
> BTW, the port doesn't respect CC/CXX and LDFLAGS in make.conf/environ as
> well as overrides CXXFLAGS.
>
> Also audio/openal is pretty ancient. Does the port not support
> audio/openal-soft?
>
I've replaced this with USE_OPENAL=3Dyes in my local copy of the Makefile, =
as well
using the DOCSDIR and DATADIR macros. I'll change the port to also respect =
the
above flags.

> %%
> --- avp_git/Makefile~
> +++ avp_git/Makefile
> @@ -1,15 +1,8 @@
> -CC =3D gcc
> -CXX =3D g++
> -
> -CFLAGS =3D -m32 -g -Wall -pipe
> -#CFLAGS +=3D -O2
> -#CFLAGS +=3D -DNDEBUG -O6 -ffast-math -fomit-frame-pointer -march=3Dpent=
ium3 -mtune=3Dpentium4
> -
> =A0CFLAGS +=3D -Isrc -Isrc/include -Isrc/win95 -Isrc/avp -Isrc/avp/win95 =
-Isrc/avp/support -Isrc/avp/win95/frontend -Isrc/avp/win95/gadgets
> =A0CFLAGS +=3D $(shell sdl-config --cflags) $(shell openal-config --cflag=
s)
> -CXXFLAGS =3D $(CFLAGS)
> +CXXFLAGS +=3D $(CFLAGS)
>
> -LDLIBS =3D -m32 $(shell sdl-config --libs) $(shell openal-config --libs)
> +LDLIBS =3D $(shell sdl-config --libs) $(shell openal-config --libs)
>
> =A0ROOT =3D main.c files.c winapi.c stubs.c version.c mathline.c opengl.c=
 fmv.c oglfunc.c openal.c cdplayer.c menus.c net.c frustum.c kshape.c map.c=
 maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c object.c shpanim.c sp=
here.c tables.c vdb.c
> =A0AVP =3D ai_sight.c avpview.c bh_agun.c bh_ais.c bh_alien.c bh_binsw.c =
bh_cable.c bh_corpse.c bh_deathvol.c bh_debri.c bh_dummy.c bh_fan.c bh_far.=
c bh_fhug.c bh_gener.c bh_ldoor.c bh_lift.c bh_light.c bh_lnksw.c bh_ltfx.c=
 bh_marin.c bh_mission.c bh_near.c bh_pargen.c bh_plachier.c bh_plift.c bh_=
pred.c bh_queen.c bh_rubberduck.c bh_selfdest.c bh_snds.c bh_spcl.c bh_swdo=
r.c bh_track.c bh_types.c bh_videoscreen.c bh_waypt.c bh_weap.c bh_xeno.c b=
onusabilities.c cconvars.cpp cdtrackselection.cpp cheatmodes.c comp_map.c c=
omp_shp.c consolelog.cpp davehook.cpp deaths.c decal.c detaillevels.c dynam=
ics.c dynblock.c equipmnt.c extents.c game.c game_statistics.c gamecmds.cpp=
 gamevars.cpp hmodel.c hud.c inventry.c language.c lighting.c load_shp.c lo=
s.c mempool.c messagehistory.c missions.cpp movement.c paintball.c particle=
.c pfarlocs.c pheromon.c player.c pmove.c psnd.c psndproj.c pvisible.c save=
game.c scream.cpp secstats.c sfx.c stratdef.c targeting.c track.c triggers.=
c weapons.c
> @@ -48,7 +41,7 @@ OBJ =3D $(ROOTOBJ) $(AVPOBJ) $(SHAPESOBJ)
> =A0all: avp
>
> =A0avp: $(OBJ)
> - =A0 =A0 =A0 $(CXX) -o avp $(OBJ) $(LDLIBS)
> + =A0 =A0 =A0 $(CXX) -o avp $(OBJ) $(LDLIBS) $(LDFLAGS)
>
> =A0clean:
> =A0 =A0 =A0 =A0-rm -rf $(OBJ) avp
> %%
>

Note that "openal-config" is replaced by "pkg-config openal", I've
also patched that.

Thanks,
Rene



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=nAAZFb75O5yOvGmfc=TDR=QvocKrUNyudon0N>