Skip to content

Build fails on GCC 10 #5

@player-03

Description

@player-03

GCC 10 contains a breaking change: it defaults to -fno-common, which requires globals to be declared in exactly one C file, and referenced elsewhere with extern. [...] This could be fixed by declaring globals in exactly one place as noted above, or by explicitly passing -fcommon to gcc.

-Issue description on openal-soft

In Lime, this produces an error message when running lime rubuild:

/usr/bin/ld: obj/linux64/0fd0c071_panning.o:(.rodata+0x13a0): multiple definition of `FuMa2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xea0): first defined here
/usr/bin/ld: obj/linux64/0fd0c071_panning.o:(.rodata+0x13e0): multiple definition of `SN3D2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xee0): first defined here
/usr/bin/ld: obj/linux64/0fd0c071_panning.o:(.rodata+0x1420): multiple definition of `N3D2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xf20): first defined here
/usr/bin/ld: obj/linux64/0fd0c071_ALu.o:(.rodata+0x3bfa0): multiple definition of `FuMa2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xea0): first defined here
/usr/bin/ld: obj/linux64/0fd0c071_ALu.o:(.rodata+0x3bfe0): multiple definition of `SN3D2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xee0): first defined here
/usr/bin/ld: obj/linux64/0fd0c071_ALu.o:(.rodata+0x3c020): multiple definition of `N3D2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xf20): first defined here
/usr/bin/ld: obj/linux64/0fd0c071_bformatdec.o:(.rodata+0x300): multiple definition of `SN3D2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xee0): first defined here
/usr/bin/ld: obj/linux64/0fd0c071_bformatdec.o:(.rodata+0x340): multiple definition of `N3D2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xf20): first defined here
/usr/bin/ld: obj/linux64/0fd0c071_bformatdec.o:(.rodata+0x2c0): multiple definition of `FuMa2N3DScale'; obj/linux64/0fd0c071_ALc.o:(.rodata+0xea0): first defined here
collect2: error: ld returned 1 exit status

Oddly, passing -fcommon to the linker doesn't work, and that's a backwards solution anyway. Instead, we should use openal-soft's fix, as implemented in 20f5e7c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions