11-21-2014 11:13 AM
Hi,
I'm trying to cross-compile the ptpd deamon http://ptpd.sourceforge.net/ from a Ubuntu 14-04 machine to use it on a 9068.
After downloading the tar file, I've done the following:
but I get the following error
collect2: error: ld returned 1 exit status
make[2]: *** [ptpd2] Error 1
make[2]: Leaving directory `/home/user/Desktop/ptpd/ptpd-2.3.1-rc3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/Desktop/ptpd/ptpd-2.3.1-rc3'
make: *** [all] Error 2
What I am doing wrong?
Thanks in advance for any help,
Regards
Solved! Go to Solution.
11-21-2014 11:37 AM
I've forgot to say that i've also installed the toolchain for arm targets
http://www.ni.com/download/labview-real-time-module-2014/4957/en/
I can also compile and run a simple hello world project froM eclipse installed on the same ubuntu machine.
Regards
11-24-2014 09:34 AM
Is that the entire error? It looks like linking failed due to an earlier error which I would have expected to appear in the output.
I do see a couple of things in your steps that don't look quite right.
./configure --target=arm-nilrt-linux-gnueabi --host=arm-nilrt-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-nilrt- linux-gnueabi
I don't think all these should be necessary; did you get this command from NI documentation somewhere? We should probably simplify it if so. You'd need --target if you were building a cross-compile tool that itself could build code and you wanted to tell it what to build for, but ptpd2 isn't like that I don't think -- is it? Assuming it doesn't compile anything itself, you can omit --target. The default for --build should also work fine if you leave it unspecified. I don't think you need --with-libtool-sysroot either actually.
I tried reproducing your symptoms but I wasn't able to do so. I did build ptpd2 successfully for the 9068 myself from my Ubuntu-esque host system. I got it working by passing --host as you do, no --target, no --build, no --with-libtool-sysroot. I did have to specify where to find gcc with CC=<path-to-nilrt-gcc> -- without that, it builds fine but the result is for Intel, not ARM. I also hit an issue where configure incorrectly decided I needed rpl_malloc; I found this workaround on the internet: https://groups.google.com/d/msg/ikarus-users/_R0QHqwyYz8/NJ_1DuMmaEgJ (without this, the failure output ends with the same output you reported, though I'm surprised you'd have hit the same situation without specifying "CC", and at any rate there's quite a bit more error output earlier that you'd have seen).
After that, make worked and produced a ptpd2 that appears to work on my 9068. (I'm not familiar with ptpd2 so I am not making any promises that it works correctly but it loads and runs.)
12-12-2014 09:56 AM
Hi Scot, I've finally had the time to test it and it works fine.
Thanks a lot for your help.