Menu

#427 Patch to allow FLAC-1.3.1 to build on x32 systems

1.3.1
closed-fixed
Erik
None
5
2015-12-09
2015-03-07
No

FLAC fails to build on x86_64 systems using the x32 ABI as the build system attempts to link 32bit and 64bit objects. This is due to a bad assumption in the configure.ac of FLAC-1.3.1, which (not unreasonably) assumes that 32bit pointers on a 64bit CPU indicates 32bit userspace, and builds as if the host CPU was also 32bit.

The patch at https://raw.githubusercontent.com/srcshelton/gentoo-ebuilds/master/media-libs/flac/files/flac-1.3.1-x32.patch allows FLAC to build on x32 systems, and shouldn't adversely affect any other platform or ABI.

Discussion

  • Erik

    Erik - 2015-03-11

    Fixed in:

    commit 7566d3d4c11c16801e1c98093c4db33589451c17
    Author: Erik de Castro Lopo <erikd@mega-nerd.com>
    Date:   Wed Mar 11 20:51:42 2015 +1100
    
    configure.ac : Tweak for x32 architecture.
    
    The x32 architecture uses and ILP32 (32 bit ints, longs and pointers)
    on an x86_64 CPU. Since the CPU is x86_64 we need to set FLAC__CPU_X86_64
    even though the pointer size is 32 bits.
    
    Patch-from: Stuart Shelton
    Closes: https://sourceforge.net/p/flac/bugs/427/
    

    Thanks!

     
  • Erik

    Erik - 2015-03-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     FLAC fails to build on x86_64 systems using the x32 ABI as the build system attempts to link 32bit and 64bit objects.  This is due to a bad assumption in the configure.ac of FLAC-1.3.1, which (not unreasonably) assumes that 32bit pointers on a 64bit CPU indicates 32bit userspace, and builds as if the host CPU was also 32bit.
    
     The patch at https://raw.githubusercontent.com/srcshelton/gentoo-ebuilds/master/media-libs/flac/files/flac-1.3.1-x32.patch allows FLAC to build on x32 systems, and shouldn't adversely affect any other platform or ABI.
    
    • status: open --> closed-fixed
    • assigned_to: Erik
     
  • Lukáš Ručka

    Lukáš Ručka - 2015-12-09

    Edit: False alarm, the problem was on my side - I had my compiler configuration broken.

    Unfortunately the patch by Sturart does not work for me, as the build environment does not provide gnux32 target. I re-wrote the architecture detection using guidelines for Debian (https://wiki.debian.org/X32Port), succesfully tested on current gentoo with default/x32 profile.

     

    Last edit: Lukáš Ručka 2015-12-10

Log in to post a comment.