Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 00/13] Compilation with musl C library
@ 2014-09-19 14:10 Szymon Janc
  2014-09-19 14:10 ` [PATCH 01/13] sap: Fix compilation errors with musl Szymon Janc
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Hi,

This patchset constains set of rather trivial fixes for compiling BlueZ
with musl C library. Musl is quite strict WRT to includes and standard
compliance.

All patches except last 3 are missing includes fixes. Last 2 also remove
glibc extensions.

BR
Szymon Janc


Szymon Janc (13):
  sap: Fix compilation errors with musl
  lib: Fix compilation error with musl
  android/hal-audio: Fix compilation errors with musl
  tools: Fix compilation errors  with musl
  shared: Fix compilation errors  with musl
  alert: Fix compilation error with musl
  core: Fix compilation error with musl
  obexd: Fix compilation error with musl
  android/pan: Fix compilation error with musl
  android/client: Fix compilation errors with musl
  health: Use proper type for tid
  emulator: Fix compilation error with musl
  android/emulator: Fix compilation error with musl

 android/client/if-bt.c         | 2 ++
 android/client/if-gatt.c       | 2 ++
 android/client/if-hh.c         | 1 +
 android/client/if-hl.c         | 1 +
 android/client/if-pan.c        | 2 --
 android/client/if-rc.c         | 1 +
 android/client/if-sock.c       | 1 +
 android/client/tabcompletion.c | 1 +
 android/hal-audio-sbc.c        | 1 +
 android/pan.c                  | 1 +
 android/system-emulator.c      | 4 ++--
 emulator/hfp.c                 | 1 +
 emulator/le.c                  | 1 +
 emulator/serial.c              | 3 ++-
 lib/hci.c                      | 2 +-
 obexd/plugins/filesystem.c     | 2 +-
 profiles/alert/server.c        | 3 +++
 profiles/health/hdp.c          | 2 +-
 profiles/sap/sap-u8500.c       | 1 +
 src/shared/hci.c               | 1 +
 src/systemd.c                  | 1 +
 tools/amptest.c                | 2 +-
 tools/btattach.c               | 2 +-
 tools/btsnoop.c                | 1 +
 tools/ciptool.c                | 2 +-
 tools/cltest.c                 | 2 +-
 tools/hciattach.c              | 2 +-
 tools/hciattach_qualcomm.c     | 2 +-
 tools/hciattach_tialt.c        | 2 +-
 tools/hcidump.c                | 2 +-
 tools/l2ping.c                 | 2 +-
 tools/l2test.c                 | 2 +-
 tools/rfcomm.c                 | 2 +-
 33 files changed, 38 insertions(+), 19 deletions(-)

-- 
1.9.3


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 01/13] sap: Fix compilation errors with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 02/13] lib: Fix compilation error " Szymon Janc
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Fix multiple errors similar to:

profiles/sap/sap-u8500.c: In function 'send_request':
profiles/sap/sap-u8500.c:288:3: error: implicit declaration of
    function 'strerror' [-Werror=implicit-function-declaration]
   sap_error("sending request failed: %s", strerror(ENOMEM));
   ^
profiles/sap/sap-u8500.c:288:3: error: format '%s' expects argument
    of type 'char *', but argument 2 has type 'int' [-Werror=format=]
profiles/sap/sap-u8500.c:297:3: error: implicit declaration of function
    'memcpy' [-Werror=implicit-function-declaration]
   memcpy(msg->payload, param->val, param->len);
   ^
---
 profiles/sap/sap-u8500.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/profiles/sap/sap-u8500.c b/profiles/sap/sap-u8500.c
index d043029..5417d59 100644
--- a/profiles/sap/sap-u8500.c
+++ b/profiles/sap/sap-u8500.c
@@ -32,6 +32,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <glib.h>
+#include <string.h>
 
 #include <sys/socket.h>
 #include <sys/un.h>
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 02/13] lib: Fix compilation error with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
  2014-09-19 14:10 ` [PATCH 01/13] sap: Fix compilation errors with musl Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 03/13] android/hal-audio: Fix compilation errors " Szymon Janc
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

  CC       lib/hci.lo
In file included from lib/hci.c:39:0:
/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect
   #include <sys/poll.h> to <poll.h> [-Werror=cpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
  ^
cc1: all warnings being treated as errors
---
 lib/hci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/hci.c b/lib/hci.c
index 005578a..ce272f6 100644
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -33,10 +33,10 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <poll.h>
 
 #include <sys/param.h>
 #include <sys/uio.h>
-#include <sys/poll.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 03/13] android/hal-audio: Fix compilation errors with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
  2014-09-19 14:10 ` [PATCH 01/13] sap: Fix compilation errors with musl Szymon Janc
  2014-09-19 14:10 ` [PATCH 02/13] lib: Fix compilation error " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 04/13] tools: " Szymon Janc
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

  CC       android/android_audio_a2dp_default_la-hal-audio-sbc.lo
android/hal-audio-sbc.c: In function 'sbc_codec_init':
android/hal-audio-sbc.c:269:2: error: implicit declaration of function
    'calloc' [-Werror=implicit-function-declaration]
  sbc_data = calloc(sizeof(struct sbc_data), 1);
  ^
android/hal-audio-sbc.c:269:13: error: incompatible implicit
    declaration of built-in function 'calloc' [-Werror]
  sbc_data = calloc(sizeof(struct sbc_data), 1);
             ^
android/hal-audio-sbc.c: In function 'sbc_cleanup':
android/hal-audio-sbc.c:291:2: error: implicit declaration of function
   'free' [-Werror=implicit-function-declaration]
  free(codec_data);
  ^
android/hal-audio-sbc.c:291:2: error: incompatible implicit declaration
    of built-in function 'free' [-Werror]
cc1: all warnings being treated as errors
---
 android/hal-audio-sbc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/android/hal-audio-sbc.c b/android/hal-audio-sbc.c
index 0c31035..7ad3a6a 100644
--- a/android/hal-audio-sbc.c
+++ b/android/hal-audio-sbc.c
@@ -18,6 +18,7 @@
 #include <stdbool.h>
 #include <string.h>
 #include <malloc.h>
+#include <stdlib.h>
 
 #include <sbc/sbc.h>
 #include "audio-msg.h"
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 04/13] tools: Fix compilation errors  with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (2 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 03/13] android/hal-audio: Fix compilation errors " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 05/13] shared: " Szymon Janc
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

This fix number of includes for <sys/poll.h> instead of <poll.h>

  CC       tools/hciattach.o
In file included from tools/hciattach.c:41:0:
/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect
   #include <sys/poll.h> to <poll.h> [-Werror=cpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
  ^
---
 tools/amptest.c            | 2 +-
 tools/btattach.c           | 2 +-
 tools/btsnoop.c            | 1 +
 tools/ciptool.c            | 2 +-
 tools/cltest.c             | 2 +-
 tools/hciattach.c          | 2 +-
 tools/hciattach_qualcomm.c | 2 +-
 tools/hciattach_tialt.c    | 2 +-
 tools/hcidump.c            | 2 +-
 tools/l2ping.c             | 2 +-
 tools/l2test.c             | 2 +-
 tools/rfcomm.c             | 2 +-
 12 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/tools/amptest.c b/tools/amptest.c
index 6192f7e..bba0a9a 100644
--- a/tools/amptest.c
+++ b/tools/amptest.c
@@ -32,7 +32,7 @@
 #include <alloca.h>
 #include <stdlib.h>
 #include <stdbool.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 
diff --git a/tools/btattach.c b/tools/btattach.c
index 9458fd7..bdbbe16 100644
--- a/tools/btattach.c
+++ b/tools/btattach.c
@@ -35,7 +35,7 @@
 #include <getopt.h>
 #include <termios.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
+#include <poll.h>
 
 #include <bluetooth/bluetooth.h>
 #include <bluetooth/hci.h>
diff --git a/tools/btsnoop.c b/tools/btsnoop.c
index 14581f2..71191eb 100644
--- a/tools/btsnoop.c
+++ b/tools/btsnoop.c
@@ -35,6 +35,7 @@
 #include <stdbool.h>
 #include <string.h>
 #include <getopt.h>
+#include <endian.h>
 #include <arpa/inet.h>
 #include <sys/stat.h>
 
diff --git a/tools/ciptool.c b/tools/ciptool.c
index 72338dc..3ff9fb1 100644
--- a/tools/ciptool.c
+++ b/tools/ciptool.c
@@ -32,7 +32,7 @@
 #include <string.h>
 #include <getopt.h>
 #include <signal.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 
diff --git a/tools/cltest.c b/tools/cltest.c
index 4ddb98a..0231805 100644
--- a/tools/cltest.c
+++ b/tools/cltest.c
@@ -32,7 +32,7 @@
 #include <alloca.h>
 #include <stdlib.h>
 #include <stdbool.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 
diff --git a/tools/hciattach.c b/tools/hciattach.c
index 1904ac5..d8ef7e7 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -37,8 +37,8 @@
 #include <syslog.h>
 #include <termios.h>
 #include <time.h>
+#include <poll.h>
 #include <sys/time.h>
-#include <sys/poll.h>
 #include <sys/param.h>
 #include <sys/ioctl.h>
 
diff --git a/tools/hciattach_qualcomm.c b/tools/hciattach_qualcomm.c
index eb72a0f..0e25905 100644
--- a/tools/hciattach_qualcomm.c
+++ b/tools/hciattach_qualcomm.c
@@ -36,8 +36,8 @@
 #include <syslog.h>
 #include <termios.h>
 #include <time.h>
+#include <poll.h>
 #include <sys/time.h>
-#include <sys/poll.h>
 #include <sys/param.h>
 #include <sys/ioctl.h>
 #include <sys/uio.h>
diff --git a/tools/hciattach_tialt.c b/tools/hciattach_tialt.c
index 5c7f3a5..a7c1706 100644
--- a/tools/hciattach_tialt.c
+++ b/tools/hciattach_tialt.c
@@ -35,8 +35,8 @@
 #include <syslog.h>
 #include <termios.h>
 #include <time.h>
+#include <poll.h>
 #include <sys/time.h>
-#include <sys/poll.h>
 #include <sys/param.h>
 #include <sys/ioctl.h>
 #include <sys/uio.h>
diff --git a/tools/hcidump.c b/tools/hcidump.c
index 37a9f00..8839eb0 100644
--- a/tools/hcidump.c
+++ b/tools/hcidump.c
@@ -33,7 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <getopt.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
diff --git a/tools/l2ping.c b/tools/l2ping.c
index 29fb3d0..3dd437e 100644
--- a/tools/l2ping.c
+++ b/tools/l2ping.c
@@ -35,7 +35,7 @@
 #include <getopt.h>
 #include <signal.h>
 #include <sys/time.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/socket.h>
 
 #include <bluetooth/bluetooth.h>
diff --git a/tools/l2test.c b/tools/l2test.c
index 67ca70a..71ad109 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -38,7 +38,7 @@
 #include <syslog.h>
 #include <signal.h>
 #include <sys/time.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 
diff --git a/tools/rfcomm.c b/tools/rfcomm.c
index b5bea38..659bbec 100644
--- a/tools/rfcomm.c
+++ b/tools/rfcomm.c
@@ -34,7 +34,7 @@
 #include <getopt.h>
 #include <signal.h>
 #include <termios.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/param.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 05/13] shared: Fix compilation errors  with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (3 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 04/13] tools: " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 06/13] alert: Fix compilation error " Szymon Janc
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

C       src/shared/hci.o
src/shared/hci.c: In function 'send_command':
src/shared/hci.c:139:2: error: implicit declaration of function
    'writev' [-Werror=implicit-function-declaration]
  if (writev(fd, iov, iovcnt) < 0)
  ^
cc1: all warnings being treated as errors
Makefile:5422: recipe for target 'src/shared/hci.o' failed
make[1]: *** [src/shared/hci.o] Error 1
---
 src/shared/hci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/shared/hci.c b/src/shared/hci.c
index 6d0a5f8..6ce62eb 100644
--- a/src/shared/hci.c
+++ b/src/shared/hci.c
@@ -29,6 +29,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <sys/socket.h>
+#include <sys/uio.h>
 
 #include "monitor/bt.h"
 #include "monitor/mainloop.h"
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 06/13] alert: Fix compilation error with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (4 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 05/13] shared: " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 07/13] core: " Szymon Janc
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

  CC       profiles/alert/bluetoothd-server.o
In file included from profiles/alert/server.c:49:0:
./src/textfile.h:24:1: error: unknown type name 'mode_t'
 int create_file(const char *filename, const mode_t mode);
 ^
Makefile:7469: recipe for target 'profiles/alert/bluetoothd-server.o'
    failed
make[1]: *** [profiles/alert/bluetoothd-server.o] Error 1
Makefile:3072: recipe for target 'all' failed
---
 profiles/alert/server.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/profiles/alert/server.c b/profiles/alert/server.c
index 1612d6c..8601bf1 100644
--- a/profiles/alert/server.c
+++ b/profiles/alert/server.c
@@ -31,6 +31,9 @@
 #include <gdbus/gdbus.h>
 #include <glib.h>
 #include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 
 #include "lib/uuid.h"
 #include "src/plugin.h"
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 07/13] core: Fix compilation error with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (5 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 06/13] alert: Fix compilation error " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 08/13] obexd: " Szymon Janc
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

  CC       profiles/alert/bluetoothd-server.o
In file included from profiles/alert/server.c:49:0:
./src/textfile.h:24:1: error: unknown type name 'mode_t'
 int create_file(const char *filename, const mode_t mode);
 ^
Makefile:7469: recipe for target 'profiles/alert/bluetoothd-server.o'
   failed
make[1]: *** [profiles/alert/bluetoothd-server.o] Error 1
Makefile:3072: recipe for target 'all' failed
---
 src/systemd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/systemd.c b/src/systemd.c
index f0985d1..cf3da1c 100644
--- a/src/systemd.c
+++ b/src/systemd.c
@@ -30,6 +30,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <stddef.h>
+#include <string.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 08/13] obexd: Fix compilation error with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (6 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 07/13] core: " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 09/13] android/pan: " Szymon Janc
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

  CC       obexd/plugins/obexd-filesystem.o
In file included from obexd/plugins/filesystem.c:40:0:
/usr/include/wait.h:1:2: error: #warning redirecting incorrect
    #include <wait.h> to <sys/wait.h> [-Werror=cpp]
 #warning redirecting incorrect #include <wait.h> to <sys/wait.h>
  ^
cc1: all warnings being treated as errors
Makefile:6447: recipe for target 'obexd/plugins/obexd-filesystem.o' failed
make[1]: *** [obexd/plugins/obexd-filesystem.o] Error 1
---
 obexd/plugins/filesystem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/obexd/plugins/filesystem.c b/obexd/plugins/filesystem.c
index 1132a34..98281f2 100644
--- a/obexd/plugins/filesystem.c
+++ b/obexd/plugins/filesystem.c
@@ -37,7 +37,7 @@
 #include <sys/statvfs.h>
 #include <sys/sendfile.h>
 #include <fcntl.h>
-#include <wait.h>
+#include <sys/wait.h>
 #include <inttypes.h>
 
 #include <glib.h>
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 09/13] android/pan: Fix compilation error with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (7 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 08/13] obexd: " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 10/13] android/client: Fix compilation errors " Szymon Janc
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

  CC       android/pan.o
android/pan.c: In function 'bridge_if_down':
android/pan.c:153:33: error: 'caddr_t' undeclared
   (first use in this function)
  err = ioctl(sk, SIOCSIFFLAGS, (caddr_t) &ifr);
                                 ^
android/pan.c:153:33: note: each undeclared identifier
   is reported only once for each function it appears in
Makefile:5422: recipe for target 'android/pan.o' failed
make[1]: *** [android/pan.o] Error 1
---
 android/pan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/android/pan.c b/android/pan.c
index d8572cc..6131890 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -34,6 +34,7 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
+#include <sys/types.h>
 #include <net/if.h>
 #include <linux/sockios.h>
 #include <netinet/in.h>
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 10/13] android/client: Fix compilation errors with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (8 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 09/13] android/pan: " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 11/13] health: Use proper type for tid Szymon Janc
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Fix number of build errors similar to:

  CC       android/client/android_haltest-tabcompletion.o
android/client/tabcompletion.c: In function 'print_matches':
android/client/tabcompletion.c:52:3: error: implicit declaration of
   function 'strncmp' [-Werror=implicit-function-declaration]
   if (strncmp(enum_name, prefix, len) == 0)
   ^
android/client/tabcompletion.c: In function 'split_command':
android/client/tabcompletion.c:87:3: error: implicit declaration of
    function 'strncpy' [-Werror=implicit-function-declaration]
   strncpy(arg->ntcopy, arg->origin, len);
   ^
---
 android/client/if-bt.c         | 2 ++
 android/client/if-gatt.c       | 2 ++
 android/client/if-hh.c         | 1 +
 android/client/if-hl.c         | 1 +
 android/client/if-pan.c        | 2 --
 android/client/if-rc.c         | 1 +
 android/client/if-sock.c       | 1 +
 android/client/tabcompletion.c | 1 +
 8 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/android/client/if-bt.c b/android/client/if-bt.c
index 218e254..4abfd53 100644
--- a/android/client/if-bt.c
+++ b/android/client/if-bt.c
@@ -15,6 +15,8 @@
  *
  */
 
+#include <string.h>
+
 #include "if-main.h"
 #include "terminal.h"
 #include "../hal-utils.h"
diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c
index 0ceffa6..3691bcc 100644
--- a/android/client/if-gatt.c
+++ b/android/client/if-gatt.c
@@ -15,6 +15,8 @@
  *
  */
 
+#include <string.h>
+
 #include <hardware/bluetooth.h>
 
 #include "../hal-utils.h"
diff --git a/android/client/if-hh.c b/android/client/if-hh.c
index df3fd30..b2bf8ca 100644
--- a/android/client/if-hh.c
+++ b/android/client/if-hh.c
@@ -17,6 +17,7 @@
 
 #include <stdio.h>
 #include <ctype.h>
+#include <string.h>
 
 #include <hardware/bluetooth.h>
 #include <hardware/bt_hh.h>
diff --git a/android/client/if-hl.c b/android/client/if-hl.c
index a3c351c..e0818ba 100644
--- a/android/client/if-hl.c
+++ b/android/client/if-hl.c
@@ -18,6 +18,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <unistd.h>
+#include <string.h>
 
 #include <hardware/bluetooth.h>
 #include <hardware/bt_hl.h>
diff --git a/android/client/if-pan.c b/android/client/if-pan.c
index bdb36cc..6207f6e 100644
--- a/android/client/if-pan.c
+++ b/android/client/if-pan.c
@@ -15,8 +15,6 @@
  *
  */
 
-#include <hardware/bluetooth.h>
-
 #include "if-main.h"
 #include "../hal-utils.h"
 
diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index afd90a3..ed65600 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -17,6 +17,7 @@
 
 #include <stdio.h>
 #include <ctype.h>
+#include <string.h>
 
 #include <hardware/bluetooth.h>
 #include <hardware/bt_hh.h>
diff --git a/android/client/if-sock.c b/android/client/if-sock.c
index 20a1fc8..ee2c1e8 100644
--- a/android/client/if-sock.c
+++ b/android/client/if-sock.c
@@ -18,6 +18,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <unistd.h>
+#include <string.h>
 
 #include "if-main.h"
 #include "pollhandler.h"
diff --git a/android/client/tabcompletion.c b/android/client/tabcompletion.c
index cf3fd80..bcca5fa 100644
--- a/android/client/tabcompletion.c
+++ b/android/client/tabcompletion.c
@@ -17,6 +17,7 @@
 
 #include <stdio.h>
 #include <ctype.h>
+#include <string.h>
 #include "if-main.h"
 #include "terminal.h"
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 11/13] health: Use proper type for tid
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (9 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 10/13] android/client: Fix compilation errors " Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 12/13] emulator: Fix compilation error with musl Szymon Janc
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

tid holds glib source id and should be of guint type.

This fix following compilation error with musl:
  CC       profiles/health/bluetoothd-hdp.o
profiles/health/hdp.c:84:2: error: unknown type name 'uint'
  uint   tid;  /* echo timeout */
  ^

 Please enter the commit message for your changes. Lines starting
---
 profiles/health/hdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/health/hdp.c b/profiles/health/hdp.c
index d09bdd4..8ffcd91 100644
--- a/profiles/health/hdp.c
+++ b/profiles/health/hdp.c
@@ -81,7 +81,7 @@ struct hdp_tmp_dc_data {
 struct hdp_echo_data {
 	gboolean		echo_done;	/* Is a echo was already done */
 	gpointer		buf;		/* echo packet sent */
-	uint			tid;		/* echo timeout */
+	guint			tid;		/* echo timeout */
 };
 
 static struct hdp_channel *hdp_channel_ref(struct hdp_channel *chan)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 12/13] emulator: Fix compilation error with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (10 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 11/13] health: Use proper type for tid Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-19 14:10 ` [PATCH 13/13] android/emulator: " Szymon Janc
  2014-09-24 18:33 ` [PATCH 00/13] Compilation with musl C library Johan Hedberg
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

make --no-print-directory all-am
  CC       emulator/serial.o
emulator/serial.c: In function 'open_pty':
emulator/serial.c:162:2: error: implicit declaration of
    function 'getpt' [-Werror=implicit-function-declaration]
  serial->fd = getpt();
  ^

  CC       emulator/le.o
emulator/le.c: In function 'send_event':
emulator/le.c:224:2: error: implicit declaration of function
    'writev' [-Werror=implicit-function-declaration]
  if (writev(hci->vhci_fd, iov, iovcnt) < 0)
  ^
---
 emulator/hfp.c    | 1 +
 emulator/le.c     | 1 +
 emulator/serial.c | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/emulator/hfp.c b/emulator/hfp.c
index 928a729..55e912c 100644
--- a/emulator/hfp.c
+++ b/emulator/hfp.c
@@ -30,6 +30,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 
diff --git a/emulator/le.c b/emulator/le.c
index 0a1b00d..955f08f 100644
--- a/emulator/le.c
+++ b/emulator/le.c
@@ -32,6 +32,7 @@
 #include <string.h>
 #include <sys/socket.h>
 #include <sys/un.h>
+#include <sys/uio.h>
 
 #include <bluetooth/bluetooth.h>
 #include <bluetooth/hci.h>
diff --git a/emulator/serial.c b/emulator/serial.c
index 9583be4..271e882 100644
--- a/emulator/serial.c
+++ b/emulator/serial.c
@@ -32,6 +32,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <fcntl.h>
 #include <sys/param.h>
 #include <sys/epoll.h>
 #include <sys/uio.h>
@@ -160,7 +161,7 @@ static void open_pty(struct serial *serial)
 {
 	enum btdev_type uninitialized_var(type);
 
-	serial->fd = getpt();
+	serial->fd = open("/dev/ptmx", O_RDWR | O_NOCTTY);
 	if (serial->fd < 0) {
 		perror("Failed to get master pseudo terminal");
 		return;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 13/13] android/emulator: Fix compilation error with musl
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (11 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 12/13] emulator: Fix compilation error with musl Szymon Janc
@ 2014-09-19 14:10 ` Szymon Janc
  2014-09-24 18:33 ` [PATCH 00/13] Compilation with musl C library Johan Hedberg
  13 siblings, 0 replies; 15+ messages in thread
From: Szymon Janc @ 2014-09-19 14:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

  CC       android/system-emulator.o
In file included from android/system-emulator.c:35:0:
/usr/include/sys/poll.h:1:2: error: #warning redirecting
   incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
  ^
android/system-emulator.c: In function 'signal_callback':
android/system-emulator.c:196:18: error: 'WAIT_ANY' undeclared
   (first use in this function)
    pid = waitpid(WAIT_ANY, &status, WNOHANG);
                  ^
android/system-emulator.c:196:18: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
---
 android/system-emulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/system-emulator.c b/android/system-emulator.c
index 4adc109..71e4d9e 100644
--- a/android/system-emulator.c
+++ b/android/system-emulator.c
@@ -32,7 +32,7 @@
 #include <signal.h>
 #include <string.h>
 #include <libgen.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/wait.h>
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -193,7 +193,7 @@ static void signal_callback(int signum, void *user_data)
 			pid_t pid;
 			int status;
 
-			pid = waitpid(WAIT_ANY, &status, WNOHANG);
+			pid = waitpid(-1, &status, WNOHANG);
 			if (pid < 0 || pid == 0)
 				break;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/13] Compilation with musl C library
  2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
                   ` (12 preceding siblings ...)
  2014-09-19 14:10 ` [PATCH 13/13] android/emulator: " Szymon Janc
@ 2014-09-24 18:33 ` Johan Hedberg
  13 siblings, 0 replies; 15+ messages in thread
From: Johan Hedberg @ 2014-09-24 18:33 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Fri, Sep 19, 2014, Szymon Janc wrote:
> This patchset constains set of rather trivial fixes for compiling BlueZ
> with musl C library. Musl is quite strict WRT to includes and standard
> compliance.
> 
> All patches except last 3 are missing includes fixes. Last 2 also remove
> glibc extensions.
> 
> BR
> Szymon Janc
> 
> 
> Szymon Janc (13):
>   sap: Fix compilation errors with musl
>   lib: Fix compilation error with musl
>   android/hal-audio: Fix compilation errors with musl
>   tools: Fix compilation errors  with musl
>   shared: Fix compilation errors  with musl
>   alert: Fix compilation error with musl
>   core: Fix compilation error with musl
>   obexd: Fix compilation error with musl
>   android/pan: Fix compilation error with musl
>   android/client: Fix compilation errors with musl
>   health: Use proper type for tid
>   emulator: Fix compilation error with musl
>   android/emulator: Fix compilation error with musl
> 
>  android/client/if-bt.c         | 2 ++
>  android/client/if-gatt.c       | 2 ++
>  android/client/if-hh.c         | 1 +
>  android/client/if-hl.c         | 1 +
>  android/client/if-pan.c        | 2 --
>  android/client/if-rc.c         | 1 +
>  android/client/if-sock.c       | 1 +
>  android/client/tabcompletion.c | 1 +
>  android/hal-audio-sbc.c        | 1 +
>  android/pan.c                  | 1 +
>  android/system-emulator.c      | 4 ++--
>  emulator/hfp.c                 | 1 +
>  emulator/le.c                  | 1 +
>  emulator/serial.c              | 3 ++-
>  lib/hci.c                      | 2 +-
>  obexd/plugins/filesystem.c     | 2 +-
>  profiles/alert/server.c        | 3 +++
>  profiles/health/hdp.c          | 2 +-
>  profiles/sap/sap-u8500.c       | 1 +
>  src/shared/hci.c               | 1 +
>  src/systemd.c                  | 1 +
>  tools/amptest.c                | 2 +-
>  tools/btattach.c               | 2 +-
>  tools/btsnoop.c                | 1 +
>  tools/ciptool.c                | 2 +-
>  tools/cltest.c                 | 2 +-
>  tools/hciattach.c              | 2 +-
>  tools/hciattach_qualcomm.c     | 2 +-
>  tools/hciattach_tialt.c        | 2 +-
>  tools/hcidump.c                | 2 +-
>  tools/l2ping.c                 | 2 +-
>  tools/l2test.c                 | 2 +-
>  tools/rfcomm.c                 | 2 +-
>  33 files changed, 38 insertions(+), 19 deletions(-)

I've applied patches 1-11 from this set. The last two require some more
discussion.

Johan

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-09-24 18:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-19 14:10 [PATCH 00/13] Compilation with musl C library Szymon Janc
2014-09-19 14:10 ` [PATCH 01/13] sap: Fix compilation errors with musl Szymon Janc
2014-09-19 14:10 ` [PATCH 02/13] lib: Fix compilation error " Szymon Janc
2014-09-19 14:10 ` [PATCH 03/13] android/hal-audio: Fix compilation errors " Szymon Janc
2014-09-19 14:10 ` [PATCH 04/13] tools: " Szymon Janc
2014-09-19 14:10 ` [PATCH 05/13] shared: " Szymon Janc
2014-09-19 14:10 ` [PATCH 06/13] alert: Fix compilation error " Szymon Janc
2014-09-19 14:10 ` [PATCH 07/13] core: " Szymon Janc
2014-09-19 14:10 ` [PATCH 08/13] obexd: " Szymon Janc
2014-09-19 14:10 ` [PATCH 09/13] android/pan: " Szymon Janc
2014-09-19 14:10 ` [PATCH 10/13] android/client: Fix compilation errors " Szymon Janc
2014-09-19 14:10 ` [PATCH 11/13] health: Use proper type for tid Szymon Janc
2014-09-19 14:10 ` [PATCH 12/13] emulator: Fix compilation error with musl Szymon Janc
2014-09-19 14:10 ` [PATCH 13/13] android/emulator: " Szymon Janc
2014-09-24 18:33 ` [PATCH 00/13] Compilation with musl C library Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox