Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926344 - net-wireless/bluez-5.76-r1 - tools/hex2hcd.c:305:18: error: call to undeclared function 'basename'
Summary: net-wireless/bluez-5.76-r1 - tools/hex2hcd.c:305:18: error: call to undeclare...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Pacho Ramos
URL: https://github.com/bluez/bluez/issues...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: musl-1.2.5
  Show dependency tree
 
Reported: 2024-03-07 10:03 UTC by ernsteiswuerfel
Modified: 2024-09-24 06:12 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (bluez-5.72:20240307-095810.log,92.80 KB, text/plain)
2024-03-07 10:03 UTC, ernsteiswuerfel
Details
emerge --info (file_926344.txt,7.42 KB, text/plain)
2024-03-07 10:04 UTC, ernsteiswuerfel
Details
build.log (5.75, amd64) (bluez-5.75:20240513-203450.log,103.52 KB, text/x-log)
2024-05-13 20:37 UTC, ernsteiswuerfel
Details
build.log (5.77, amd64) (bluez-5.77:20240814-162838.log,278.93 KB, text/plain)
2024-08-14 16:42 UTC, ernsteiswuerfel
Details
rpl.patch (rpl.patch.txt,583 bytes, text/plain)
2024-09-21 04:21 UTC, Pablo Cholaky
Details
hex2hcd fix (897.patch,1.19 KB, patch)
2024-09-21 04:27 UTC, Pablo Cholaky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(+)