Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 926344

Summary: net-wireless/bluez-5.76-r1 - tools/hex2hcd.c:305:18: error: call to undeclared function 'basename'
Product: Gentoo Linux Reporter: ernsteiswuerfel <erhard_f>
Component: Current packagesAssignee: Pacho Ramos <pacho>
Status: RESOLVED FIXED    
Severity: normal CC: erhard_f, ionen, strdenis02, waltercool
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/bluez/bluez/issues/843
See Also: https://github.com/bluez/bluez/pull/897
https://github.com/bluez/bluez/pull/936
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 926147    
Attachments: build.log
emerge --info
build.log (5.75, amd64)
build.log (5.77, amd64)
rpl.patch
hex2hcd fix

Description ernsteiswuerfel archtester 2024-03-07 10:03:33 UTC
Created attachment 886893 [details]
build.log

[...]
/bin/sh ./libtool  --tag=CC   --mode=link clang       -Os -march=x86-64-v2 -pipe  -fuse-ld=bfd -Wl,-O1 -Wl,--as-needed -o tools/bluemoon tools/bluemoon.o src/libshared-mainloop.la 
libtool: link: clang -Os -march=x86-64-v2 -pipe -fuse-ld=bfd -Wl,-O1 -o tools/bluemoon tools/bluemoon.o  -Wl,--as-needed src/.libs/libshared-mainloop.a
clang -DHAVE_CONFIG_H -I.   -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/elogind -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I./lib        -Os -march=x86-64-v2 -pipe -c -o tools/hex2hcd.o tools/hex2hcd.c
tools/hex2hcd.c:305:18: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  305 |                 ver_parse_file(basename(pathname));
      |                                ^
tools/hex2hcd.c:305:18: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
  305 |                 ver_parse_file(basename(pathname));
      |                                ^~~~~~~~~~~~~~~~~~
tools/hex2hcd.c:234:40: note: passing argument to parameter 'pathname' here
  234 | static void ver_parse_file(const char *pathname)
      |                                        ^
2 errors generated.
make[1]: *** [Makefile:7839: tools/hex2hcd.o] Error 1
make: *** [Makefile:4689: all] Error 2
Comment 1 ernsteiswuerfel archtester 2024-03-07 10:04:58 UTC
Created attachment 886894 [details]
emerge --info
Comment 2 ernsteiswuerfel archtester 2024-05-13 20:37:25 UTC
Created attachment 892893 [details]
build.log (5.75, amd64)
Comment 3 ernsteiswuerfel archtester 2024-05-13 20:48:23 UTC
Opened an upstream issue about it: https://github.com/bluez/bluez/issues/843
Comment 4 Agostino Sarubbo gentoo-dev 2024-06-30 07:00:27 UTC
tinderbox_musl has reproduced this issue with version 5.76-r1 - Updating summary.
Comment 6 ernsteiswuerfel archtester 2024-08-14 16:42:28 UTC
Created attachment 900108 [details]
build.log (5.77, amd64)

This specific issue gets fixed with the patch above.

But there are yet more similar issues remaining it seems:

[...]
clang -DHAVE_CONFIG_H -I.   -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/elogind -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I./lib  -ffunction-sections -fdata-sections      -Os -march=x86-64-v2 -pipe -c -o mesh/rpl.o mesh/rpl.c
mesh/rpl.c:149:11: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  149 |         iv_txt = basename(iv_path);
      |                  ^
mesh/rpl.c:149:9: error: incompatible integer to pointer conversion assigning to 'const char *' from 'int' [-Wint-conversion]
  149 |         iv_txt = basename(iv_path);
      |                ^ ~~~~~~~~~~~~~~~~~
2 errors generated.
make[1]: *** [Makefile:7845: mesh/rpl.o] Error 1
make: *** [Makefile:4669: all] Error 2
[...]
Comment 7 Pablo Cholaky 2024-09-21 04:21:28 UTC
You also need to apply the rpi patch mentioned here:

https://github.com/bluez/bluez/issues/843#issuecomment-2292487244
Comment 8 Pablo Cholaky 2024-09-21 04:21:59 UTC
Created attachment 903479 [details]
rpl.patch
Comment 9 Pablo Cholaky 2024-09-21 04:27:12 UTC
Created attachment 903480 [details, diff]
hex2hcd fix

hex2hcd fix from https://github.com/bluez/bluez/pull/897
Comment 10 Larry the Git Cow gentoo-dev 2024-09-24 06:12:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5d8c3399a48d1eadc97063b7c538c06aa065a01

commit c5d8c3399a48d1eadc97063b7c538c06aa065a01
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-24 06:11:17 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-24 06:11:17 +0000

    net-wireless/bluez: fix musl build
    
    Closes: https://bugs.gentoo.org/926344
    Signed-off-by: Sam James <sam@gentoo.org>

 net-wireless/bluez/bluez-5.78.ebuild               |   3 +
 .../bluez/files/bluez-5.78-musl-1.2.5.patch        | 312 +++++++++++++++++++++
 2 files changed, 315 insertions(+)