-gen gcc gives different @N stdcall suffix than -gen gas for procedures with non-trivial byval parameters:
type complextype
bigdata(0 to 1000-1) as byte
declare destructor()
end type
destructor complextype()
end destructor
declare sub a(byval as string)
declare sub b(byval as complextype)
a("")
dim x as complextype
b(x)
'' fbc 1.05.0 target win32 -gen gas
'' 2.o:fake:(.text+0x64): undefined reference to `A@12'
'' 2.o:fake:(.text+0xa9): undefined reference to `B@1000'
'' fbc 1.05.0 target win32 -gen gcc
'' 2.o:fake:(.text+0x97): undefined reference to `A@4'
'' 2.o:fake:(.text+0x110): undefined reference to `B@4'
As far as I know -gen gas is correct in this case; I checked it against g++ and msvc behaviour a while ago: [4346f9]
gcc only sees an FBSTRING * or complextype * and uses the pointer size. fbc already has support for working around such problems (see hNeedAlias() and hGetMangledNameForASM in ir-hlc.bas), it probably needs to be enabled for all functions with non-trivial byval parameters (or just all functions).
Diff:
Related
Commit: [4346f9]
Fixed in commit [d249ff]
Related
Commit: [d249ff]