Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587498 - sys-apps/tcp-wrappers-7.6.22-r1: can't compile on musl
Summary: sys-apps/tcp-wrappers-7.6.22-r1: can't compile on musl
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-29 09:54 UTC by Sergey 'L29Ah' Alirzaev
Modified: 2021-07-12 02:49 UTC (History)
2 users (show)

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


Attachments
emerge --info (emerge.info,12.05 KB, application/x-info)
2016-06-30 18:02 UTC, Sergey 'L29Ah' Alirzaev
Details
build log (build.log,13.80 KB, text/plain)
2016-06-30 18:06 UTC, Sergey 'L29Ah' Alirzaev
Details
Patch against tcp-wrappers-7.6.22 (tcp-wrappers-7.6.22-remove-DECLS.patch,317 bytes, patch)
2016-07-04 10:00 UTC, Felix Janda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 'L29Ah' Alirzaev 2016-06-29 09:54:48 UTC
musl arm vanilla stage3 here


In file included from tcpd.c:40:0:
tcpd.h:20:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
 struct host_info {
 ^
tcpd.c:42:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
 void fix_options(struct request_info *request);
 ^
In file included from hosts_access.c:56:0:
tcpd.h:20:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
 struct host_info {
 ^
In file included from shell_cmd.c:35:0:
tcpd.h:20:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
 struct host_info {
 ^
hosts_access.c:60:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘extern’
 extern jmp_buf tcpd_buf;
 ^
In file included from options.c:61:0:
tcpd.h:20:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
 struct host_info {
 ^
options.c:65:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
 int     dry_run = 0;   /* flag set in verification mode */
 ^
shell_cmd.c:39:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘static’
 static void do_child();
 ^
hosts_access.c: In function ‘hosts_access’:
hosts_access.c:133:22: error: ‘tcpd_buf’ undeclared (first use in this function)
     verdict = setjmp(tcpd_buf);
                      ^
hosts_access.c:133:22: note: each undeclared identifier is reported only once for each function it appears in
shell_cmd.c:112:13: warning: conflicting types for ‘do_child’
 static void do_child(command)
             ^
shell_cmd.c:112:13: error: static declaration of ‘do_child’ follows non-static declaration
shell_cmd.c:90:2: note: previous implicit declaration of ‘do_child’ was here
  do_child(command);
  ^
Makefile:686: recipe for target 'tcpd.o' failed
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2016-06-30 15:17:11 UTC
Please attach the complete build.log and the output of the "emerge --info" command.
Comment 2 Sergey 'L29Ah' Alirzaev 2016-06-30 18:02:30 UTC
Created attachment 439250 [details]
emerge --info
Comment 3 Sergey 'L29Ah' Alirzaev 2016-06-30 18:06:24 UTC
Created attachment 439252 [details]
build log
Comment 4 SpanKY gentoo-dev 2016-07-04 02:00:28 UTC
most likely some incompatibility with musl specifically
Comment 5 Felix Janda 2016-07-04 07:36:13 UTC
When using a musl stage the musl overlay should also be used. Many
other packages will fail to compile without it.

It adds a patch tcp-wrappers-7.6.22-remove-DECLS.patch which should not
break anything else (and fix this bug). Maybe it can be included in the
main tree. Here it is:

diff -Naur tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
--- tcp_wrappers_7.6.orig/tcpd.h	2014-03-24 18:39:52.000000000 +0000
+++ tcp_wrappers_7.6/tcpd.h	2014-03-24 18:48:21.000000000 +0000
@@ -11,7 +11,9 @@
 #include <netinet/in.h>
 #include <stdio.h>
 
+#ifdef __cplusplus
 __BEGIN_DECLS
+#endif
 
 /* Structure to describe one communications endpoint. */
 
@@ -252,6 +254,8 @@
 extern char *my_strtok();
 #endif
 
+#ifdef __cplusplus
 __END_DECLS
+#endif
 
 #endif
Comment 6 Felix Janda 2016-07-04 10:00:15 UTC
Created attachment 439666 [details, diff]
Patch against tcp-wrappers-7.6.22

Actually, the patch from the musl overlay is not completely correct
(does not work with C++ programs using tcpd.h). See the attached
corrected patch.
Comment 7 Sergey 'L29Ah' Alirzaev 2016-07-04 10:51:15 UTC
It works if installed from the overlay, thank you.
Comment 8 Fabian Groffen gentoo-dev 2021-05-21 10:05:48 UTC
I agree Felix' patch (comment #6) looks better and can confirm it fixes the build with musl.

Ok to commit that patch to -r2?
Comment 9 Larry the Git Cow gentoo-dev 2021-07-12 02:49:47 UTC
The bug has been closed via the following commit(s):

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

commit d3f24e117981dfca2b86c97525b8c82566bcc022
Author:     John Helmert III <ajak@gentoo.org>
AuthorDate: 2021-07-12 02:45:15 +0000
Commit:     John Helmert III <ajak@gentoo.org>
CommitDate: 2021-07-12 02:48:19 +0000

    sys-apps/tcp-wrappers: add 7.6.31
    
    Bumps to Debian patchset 31, fixes musl compilation.
    
    Closes: https://bugs.gentoo.org/587498
    Acked-by: Sam James <sam@gentoo.org>
    Signed-off-by: John Helmert III <ajak@gentoo.org>

 sys-apps/tcp-wrappers/Manifest                   |   1 +
 sys-apps/tcp-wrappers/tcp-wrappers-7.6.31.ebuild | 108 +++++++++++++++++++++++
 2 files changed, 109 insertions(+)