Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 522042 - dev-libs/openssl[-ipv6]: build fails when using sys-libs/uclibc[-ipv6]
Summary: dev-libs/openssl[-ipv6]: build fails when using sys-libs/uclibc[-ipv6]
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: uclibc-porting
  Show dependency tree
 
Reported: 2014-09-03 11:51 UTC by David Flogeras
Modified: 2018-10-14 12:14 UTC (History)
0 users

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


Attachments
failed build.log (build.log,556.33 KB, text/plain)
2014-09-03 11:52 UTC, David Flogeras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Flogeras 2014-09-03 11:51:53 UTC
I have an armv6j (RPi) system using uClibc.  It has always had IPv6 turned off (both in uClibc, and in the kernel).  Trying to upgrade it today from openssl-1.0.1h-r1 to openssl-1.0.1i, results in undeclared IPV6_V6ONLY and in6addr_any errors.  I'll attach the build log.

Reproducible: Always
Comment 1 David Flogeras 2014-09-03 11:52:55 UTC
Created attachment 384156 [details]
failed build.log
Comment 2 David Flogeras 2014-09-03 11:55:17 UTC
The unsupported ioctl's are because I am compiling inside of a qemu chroot
Comment 3 Anthony Basile gentoo-dev 2014-09-03 23:16:49 UTC
The offending code in s_socket.c is around line 401:

#if OPENSSL_USE_IPV6
        if ((use_ipv4 == 0) && (use_ipv6 == 1))
                {
                const int on = 1;

                setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
                           (const void *) &on, sizeof(int));
                }
#endif

and line 429

#if OPENSSL_USE_IPV6
        else
                {
                addr_len = (socklen_t)sizeof(struct sockaddr_in6);
                memset(server_in6, 0, sizeof(struct sockaddr_in6));
                server_in6->sin6_family = AF_INET6;
                server_in6->sin6_port = htons((unsigned short)port);
                if (ip == NULL)
                        server_in6->sin6_addr = in6addr_any;
                else
                        memcpy(&server_in6->sin6_addr, ip, sizeof(struct in6_addr));
                }
#endif


But I don't understand why you get there, because of the #if's.  There is another problem though.  There is a bad patch on s_socket.c.  Looks like this patch is going to need some work.

yellow openssl-1.0.1i # patch -p1 < /usr/portage/dev-libs/openssl/files/openssl-1.0.1h-ipv6.patch 
patching file apps/s_apps.h
patching file apps/s_client.c
Hunk #2 succeeded at 574 (offset 2 lines).
Hunk #3 succeeded at 620 (offset 2 lines).
Hunk #4 succeeded at 639 (offset 2 lines).
Hunk #5 succeeded at 966 (offset 2 lines).
Hunk #6 succeeded at 1289 (offset 2 lines).
Hunk #7 succeeded at 1315 (offset 2 lines).
patching file apps/s_server.c
Hunk #1 succeeded at 562 with fuzz 1 (offset 2 lines).
Hunk #2 succeeded at 957 (offset 6 lines).
Hunk #3 succeeded at 986 (offset 6 lines).
Hunk #4 succeeded at 1340 (offset 6 lines).
Hunk #5 succeeded at 1918 (offset 14 lines).
patching file apps/s_socket.c
patching file apps/s_socket.c.rej
Comment 4 Anthony Basile gentoo-dev 2014-09-03 23:56:35 UTC
Okay a few points:

1) the above broken patch is not the culprit, but still a problem

2) this is arch independant, i hit it on i686

3) e_os.h is braindead.  It defines OPENSSL_USE_IPV6 in e_os.h around line 632 as

#  if !defined(OPENSSL_USE_IPV6)
#    if defined(AF_INET6) && !defined(OPENSSL_SYS_BEOS_BONE) && !defined(NETWARE_CLIB)
#      define OPENSSL_USE_IPV6 1
#    else
#      define OPENSSL_USE_IPV6 0
#    endif
#  endif

So we end up defining OPENSSL_USE_IPV6 1 because AF_INET6 is defined even if we build uclibc with UCLIBC_HAS_IPV6 unset.

I really don't want to add a USE=ipv6 flag to the ebuild.  Let me think about how to fix this right.
Comment 5 Anthony Basile gentoo-dev 2018-10-14 12:14:47 UTC
sys-libs/uclibc has been removed from the tree, replaced by sys-libs/uclibc-ng.  if this is still a problem on uclibc-ng, please open a new bug.