QNX6.6 cross-compilation problem

Nicolas Pinault nicolasp at aaton.com
Mon Feb 17 15:14:21 UTC 2020


Hi Uri,

I'm using Ubuntu 18.04.4 LTS (32-bit).
I use vanilla Samba sources (4.11.6) downloaded directly from Samba WEB 
site. No patch applied.
I was using Python 3.5. However, I was not confident with this Python 
installation (I had problems with other tools using Python3). So I 
installed Python3.6.
Of course, while I thought I was using Python3.6, I was in fact using 
Python3.5 in some places. Following your request, I triple checked and 
corrected this problem.

So :
With Python3.6, I get the same problem with --jobs >  1.
With Python3.6 and --jobs=1, the configuration does not hangs anymore.

After fighting many hours with my system, configuration step ends 
without error.

My configure cmd is :
CC=ntoarmv7-gcc AR=ntoarmv7-ar LD=armv7nto-ld GDB=armv7nto-gdb 
CFLAGS=-I/home/nicolas/qnx660/target/qnx6/usr/include waf configure 
--cross-compile --cross-execute='python3.6 execute_on_target.py' 
--jobs=1 --disable-python --without-ad-dc --python=/usr/bin/python3.6 
--without-pie --disable-cups --disable-iprint 
--with-configdir=/etc/samba --with-logfilebase=/tmp/samba 
--with-lockdir=/tmp/samba --with-piddir=/tmp/samba 
--with-privatedir=/etc/samba/private --without-libarchive 
--localstatedir=/var --without-gettext --without-ldb-lmdb 
--without-systemd --without-lttng --without-ntvfs-fileserver 
--without-json --without-relro --disable-tdb-mutex-locking 
--without-ldap --without-ads --without-pam --disable-rpath

But build fails...
When running "waf -vv", I get :
Waf: Entering directory `/home/nicolas/samba/samba-4.11.6/bin/default'
     Selected embedded Heimdal build
[116/287] Processing source4/heimdal/lib/asn1/kx509.asn1
15:39:11 runner ' cd 
"/home/nicolas/samba/samba-4.11.6/bin/default/source4/heimdal/lib/asn1" 
&& "/home/nicolas/samba/samba-4.11.6/bin/asn1_compile" --one-code-file 
"/home/nicolas/samba/samba-4.11.6/source4/heimdal/lib/asn1/kx509.asn1" 
kx509_asn1 '
/bin/sh: 1: /home/nicolas/samba/samba-4.11.6/bin/asn1_compile: Exec 
format error

Waf: Leaving directory `/home/nicolas/samba/samba-4.11.6/bin/default'
   File "/home/nicolas/samba/samba-4.11.6/buildtools/bin/waf", line 166, 
in <module>
     Scripting.waf_entry_point(cwd, VERSION, wafdir[0])
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Scripting.py", 
line 159, in waf_entry_point
     run_commands()
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Scripting.py", 
line 255, in run_commands
     ctx = run_command(cmd_name)
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Scripting.py", 
line 239, in run_command
     ctx.execute()
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Scripting.py", 
line 582, in execute
     return execute_method(self)
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Build.py", line 
231, in execute
     self.execute_build()
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Build.py", line 
251, in execute_build
     self.compile()
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Tools/errcheck.py", 
line 192, in check_compile
     ret = self.orig_compile()
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Build.py", line 
355, in compile
     raise Errors.BuildError(self.producer.error)
   File 
"/home/nicolas/samba/samba-4.11.6/third_party/waf/waflib/Errors.py", 
line 46, in __init__
     WafError.__init__(self, self.format_error())

Build failed
  -> task in 'HEIMDAL_KX509_ASN1_ASN1' failed with exit status 2:
     {task 3067614852: HEIMDAL_KX509_ASN1_ASN1 kx509.asn1 -> 
asn1_kx509_asn1.x,kx509_asn1.hx,kx509_asn1-priv.hx}
' cd 
"/home/nicolas/samba/samba-4.11.6/bin/default/source4/heimdal/lib/asn1" 
&& "/home/nicolas/samba/samba-4.11.6/bin/asn1_compile" --one-code-file 
"/home/nicolas/samba/samba-4.11.6/source4/heimdal/lib/asn1/kx509.asn1" 
kx509_asn1 '

Looks like asn1_compile is a target executable, not a host executable.
Do I have to run waf with special options when cross-compiling ?

Regards,
Nicolas

Le 14/02/2020 à 20:22, Uri Simchoni via samba-technical a écrit :
> That looks like something in Waf or in the Samba configuration scripts
> that Waf runs. Waf 2.0.x which is used by Samba 4.11.x has a worker
> process pool to carry out build / test jobs, and this pool seems to be
> stuck - won't execute a simple compilation command to run a
> configuration test.
>
> Which version of Ubuntu are you using exactly? What version of Python?
> is it vanilla Samba or did you use patches?
>
> I don't have access to QNX toolchain, but if the problem is with the
> Samba build system and the build machine (as it appears to be), then
> perhaps we can reproduce this without the specific toolchain.
>
> Thanks,
> Uri.
>
> On 14/02/2020 11:17, Nicolas Pinault via samba-technical wrote:
>> Hi,
>>
>> I'm trying to cross-compile Samba (V4.11.6) for QNX6.6.0.
>> For this, I've installed QNX dev tools on Ubuntu in a VMWare virtual
>> machine (My PC runs Windows10).
>>
>> To cross-compile Samba, the command I run is :
>> CC=ntoarmv7-gcc AR=ntoarmv7-ar LD=armv7nto-ld GDB=armv7nto-gdb
>> CFLAGS=-I/home/nicolas/qnx660/target/qnx6/usr/include waf configure
>> --cross-compile --cross-anwsers=qnx.txt
>>
>> I filled the unknown fields in the qnx.txt as requested.
>>
>> The configuration runs till it hangs at this step :
>> ...
>> Checking for pthread_mutexattr_setrobust_np : not found
>> Checking for library
>> pthread                                                      : no
>> Checking for pthread_mutexattr_setrobust_np : not found
>> Checking for declaration of
>> PTHREAD_MUTEX_ROBUST                                  : not found
>> Checking for declaration of PTHREAD_MUTEX_ROBUST (as
>> enum)                        :
>>
>> Sometimes, configuration hangs one or two steps earlier.
>>
>> bin/config.log shows :
>> ...
>> #include <pthread.h>
>>
>>   int main(void) {
>>                        return (int)PTHREAD_MUTEX_ROBUST;
>>                        ; return 0; }
>>
>> <==
>> [1/1] Compiling
>> bin/.conf_check_c3306603f996021a8dd585a3c7167deb/test.c
>>
>>
>> While the configurafion is hung, ps-ax shows the following :
>>   8302 pts/0    Sl+    0:08 python3
>> /home/nicolas/samba/samba-4.11.6/buildtools/bin/waf configure
>> --cross-compile --cross-answers=qnx.txt --jobs=4
>>   8304 pts/0    S+     0:00 /usr/local/bin/python3 -c #! /usr/bin/env
>> python # encoding: utf-8 # Thomas Nagy, 2016-2018 (ita) log_base_path =
>> "/home/nicolas/samba/"  import ...
>>   8305 pts/0    S+     0:00 /usr/local/bin/python3 -c #! /usr/bin/env
>> python # encoding: utf-8 # Thomas Nagy, 2016-2018 (ita) log_base_path =
>> "/home/nicolas/samba/"  import ...
>>   8306 pts/0    S+     0:00 /usr/local/bin/python3 -c #! /usr/bin/env
>> python # encoding: utf-8 # Thomas Nagy, 2016-2018 (ita) log_base_path =
>> "/home/nicolas/samba/"  import ...
>>   8307 pts/0    S+     0:00 /usr/local/bin/python3 -c #! /usr/bin/env
>> python # encoding: utf-8 # Thomas Nagy, 2016-2018 (ita) log_base_path =
>> "/home/nicolas/samba/"  import ...
>>
>>
>> When I comment out "Mutext Robust" tests, the configuration hangs much
>> further. But it hangs.
>>
>> As I thought it might be a concurrency problem, I tried with --jobs=1
>> option.
>> This does not work at all. Exceptions are generated at the very
>> beginning of the process.
>>
>>
>> I also tried using --cross-execute option. Same problem.
>>
>>
>> I spent days on this problem, trying different things but I'm stuck at
>> this problem.
>>
>> Any pointers ?
>>
>> Regards,
>> Nicolas
>>
>





More information about the samba-technical mailing list