[Swan-dev] Bug#854094: libreswan FTBFS on x32 due to missing <sys/time.h>

Daniel Kahn Gillmor dkg at fifthhorseman.net
Sat Feb 4 01:32:53 UTC 2017


over in https://bugs.debian.org/854094:
On Fri 2017-02-03 19:10:43 -0500, Daniel Schepler wrote:
> On Fri, Feb 3, 2017 at 3:29 PM, Daniel Kahn Gillmor
> <dkg at fifthhorseman.net> wrote:
>> Package: libreswan
>> Version: 3.19-2
>> X-Debbugs-Cc: x32 at buildd.debian.org, swan-dev at lists.libreswan.org
>>
>> Hi Debian x32 builders--
>>
>> I note that libreswan is failing to build from source on the x32
>> platform due to a missing sys/time.h:
>>
>> https://buildd.debian.org/status/fetch.php?pkg=libreswan&arch=x32&ver=3.19-2&stamp=1486146097&raw=0
>>
>>>> /<<PKGBUILDDIR>>/linux/include/libreswan.h:44:22: fatal error: sys/time.h: No such file or directory
>>  #include <sys/time.h>
>>                       ^
>>
>> the code in linux/include/libreswan.h is just:
>>
>>      42 #if !defined(__KERNEL__)
>>      43
>>      44 #include <sys/time.h>
>>      45 #include <time.h>
>>      46
>>
>> It builds on other debian platforms without a problem.  Is something
>> significantly different on x32 that we should know about?
>
> It's trying to build with -m64, which would be a cross build for amd64
> rather than a native build for x32.  (So, the immediate symptom is
> caused by the compiler looking for sys/time.h in
> /usr/include/x86_64-linux-gnu and not finding it there because
> libc6-dev-amd64 isn't installed.)

hm, i don't think we want it to build for amd64 if we're doing native
builds on x32, right?

In mk/userland-cflags.mk, we have:

ifeq ($(origin GCCM),undefined)
ifeq ($(ARCH),i686)
GCCM=-m32
endif
ifeq ($(ARCH),x86_64)
GCCM=-m64
endif
endif
USERLAND_CFLAGS+=$(GCCM)

is ARCH defined as x86_64 for x32?  If so, is there a preferred way that
libreswan should make this distinction?  or should i just manually set
GCCM to -m32 in debian/rules when building for x32?

   --dkg

PS for the libreswan folks who've just joined this thread, here's an
explanation of the x32 port on debian:

https://wiki.debian.org/X32Port
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20170203/fa15e1a7/attachment.sig>


More information about the Swan-dev mailing list