dslm4515 / BMLFS

Beyond Musl Linux From Scratch - Build Recipes for MLFS [Musl Linux From Source]
17 stars 4 forks source link

Audacious Plugins Fails to Link mpg123 module #25

Open dslm4515 opened 2 years ago

dslm4515 commented 2 years ago

When compiling:

Entering directory mpg123.
/usr/bin/ld: mpg123.plugin.o: in function `DecodeState::DecodeState(char const*, VFSFile&, bool, bool)':
/src/audacious-plugins-4.1/src/mpg123/mpg123.cc:150: undefined reference to `mpg123_replace_reader_handle'
/usr/bin/ld: /src/audacious-plugins-4.1/src/mpg123/mpg123.cc:165: undefined reference to `mpg123_open_handle'
/usr/bin/ld: mpg123.plugin.o: in function `read_mpg123_info(char const*, VFSFile&, Tuple&)':
/src/audacious-plugins-4.1/src/mpg123/mpg123.cc:262: undefined reference to `mpg123_length'
/usr/bin/ld: mpg123.plugin.o: in function `MPG123Plugin::play(char const*, VFSFile&)':
/src/audacious-plugins-4.1/src/mpg123/mpg123.cc:330: undefined reference to `mpg123_seek'
collect2: error: ld returned 1 exit status
Failed to link madplug.so!
make[5]: *** [../../buildsys.mk:228: madplug.so] Error 1
make[4]: *** [../../buildsys.mk:134: all] Error 2
make[3]: *** [../buildsys.mk:144: mpg123] Error 2
make[2]: *** [../buildsys.mk:132: all] Error 2
make[1]: *** [buildsys.mk:144: src] Error 2
make: *** [buildsys.mk:132: all] Error 2

Checking the installed mpg123 library:

$ readelf -s /usr/lib/libmpg123.so.0.46.7 | grep mpg123_open
    52: 0000000000033436    68 FUNC    GLOBAL DEFAULT   10 mpg123_open_64
    66: 00000000000336dd    52 FUNC    GLOBAL DEFAULT   10 mpg123_open_feed
    69: 00000000000335cf   107 FUNC    GLOBAL DEFAULT   10 mpg123_open_fixed_64
   149: 0000000000033679   100 FUNC    GLOBAL DEFAULT   10 mpg123_open_handle_64
   155: 000000000003363a    63 FUNC    GLOBAL DEFAULT   10 mpg123_open_fd_64

I noticed when building this CFLAG when mpg123 was built:

CFLAGS="-D_FILE_OFFSET_BITS=64"

I forgot why this flag was used. If ommited then mpg123 builds its library with these symbols instead:

$ readelf -s libmpg123* | grep mpg123_open
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
    53: 0000000000014510    54 FUNC    GLOBAL DEFAULT   11 mpg123_open_fd
    69: 0000000000014550    85 FUNC    GLOBAL DEFAULT   11 mpg123_open_handle
    74: 00000000000144b0    96 FUNC    GLOBAL DEFAULT   11 mpg123_open_fixed
    75: 00000000000143a0    54 FUNC    GLOBAL DEFAULT   11 mpg123_open
    93: 00000000000145b0    38 FUNC    GLOBAL DEFAULT   11 mpg123_open_feed
   491: 0000000000014510    54 FUNC    GLOBAL DEFAULT   11 mpg123_open_fd
   503: 00000000000144b0    96 FUNC    GLOBAL DEFAULT   11 mpg123_open_fixed
   551: 0000000000014550    85 FUNC    GLOBAL DEFAULT   11 mpg123_open_handle
   556: 00000000000145b0    38 FUNC    GLOBAL DEFAULT   11 mpg123_open_feed
   625: 00000000000143a0    54 FUNC    GLOBAL DEFAULT   11 mpg123_open
    53: 0000000000014510    54 FUNC    GLOBAL DEFAULT   11 mpg123_open_fd
    69: 0000000000014550    85 FUNC    GLOBAL DEFAULT   11 mpg123_open_handle
    74: 00000000000144b0    96 FUNC    GLOBAL DEFAULT   11 mpg123_open_fixed
    75: 00000000000143a0    54 FUNC    GLOBAL DEFAULT   11 mpg123_open
    93: 00000000000145b0    38 FUNC    GLOBAL DEFAULT   11 mpg123_open_feed
   491: 0000000000014510    54 FUNC    GLOBAL DEFAULT   11 mpg123_open_fd
   503: 00000000000144b0    96 FUNC    GLOBAL DEFAULT   11 mpg123_open_fixed
   551: 0000000000014550    85 FUNC    GLOBAL DEFAULT   11 mpg123_open_handle
   556: 00000000000145b0    38 FUNC    GLOBAL DEFAULT   11 mpg123_open_feed
   625: 00000000000143a0    54 FUNC    GLOBAL DEFAULT   11 mpg123_open
    53: 0000000000014510    54 FUNC    GLOBAL DEFAULT   11 mpg123_open_fd
    69: 0000000000014550    85 FUNC    GLOBAL DEFAULT   11 mpg123_open_handle
    74: 00000000000144b0    96 FUNC    GLOBAL DEFAULT   11 mpg123_open_fixed
    75: 00000000000143a0    54 FUNC    GLOBAL DEFAULT   11 mpg123_open
    93: 00000000000145b0    38 FUNC    GLOBAL DEFAULT   11 mpg123_open_feed
   491: 0000000000014510    54 FUNC    GLOBAL DEFAULT   11 mpg123_open_fd
   503: 00000000000144b0    96 FUNC    GLOBAL DEFAULT   11 mpg123_open_fixed
   551: 0000000000014550    85 FUNC    GLOBAL DEFAULT   11 mpg123_open_handle
   556: 00000000000145b0    38 FUNC    GLOBAL DEFAULT   11 mpg123_open_feed
   625: 00000000000143a0    54 FUNC    GLOBAL DEFAULT   11 mpg123_open

Should i remove that flag?

dslm4515 commented 2 years ago

Not sure what required those symbols to require those '_64' suffixes...

dslm4515 commented 2 years ago

Rebuilt mpg123 (with out the offset_bits set to 64) and installed it in /opt/mpg123 and prefixed configure command for audacious-plugins to use newly bilt mpg123:

MPG123_CFLAGS="-I/opt/mpg123/include"  MPG123_LIBS="/opt/mpg123/lib/libmpg123.so -lmpg123 "

Now audacious-plugins builds without error.

dslm4515 commented 2 years ago

I forgot why this flag was used

gst-plugins-good would compile but fail to link because symbols from mpg123 were not suffixed with _64