ConfD User Community

I have some question about cross-compile


#1

I would like to make cross-compile environment.
With --force, I installed confd6.4 for other architecture(powerpc) in my linux system(x86).
to make fxs file from *.yang, I ran “confdc -c aaa.yang”.
however, I couldn’t get correct result (I couldn’t see fxs file) and following message was shown.

line 29: /home/test/confd6.4/lib/confd/erts/bin/confdexec : cannot excute binary file
line 29: /home/test/confd6.4/lib/confd/erts/bin/confdexec : Success

How can I get correct environment to run cross-compile ?

Is it right to use fxs files and header files(that are made in x86) in powerpc architecture ?


#2

I believe the fxs files are platform independent. Did you try to use x86 confd compiler (on your linux system) to make fxs binary that can be used on powerpc?

I suggest to use same bit version, means 32bit version if you compile for 32bit target and same for 64bit.
Of course, for other binary files (application, object files, libraries) you need to use cross compiler (e.g. gcc).


#3

Thanks your recommendation.
I will try it right now.


#4

I should add that the IPC mechanism is platform independent as well, so you could have an application running on PPC, and the ConfD daemon running on x86.


#5

I have another question about cross-compile.

My linux system is 64-bit x86, but target is 32 bit-ppc.
I’d like to make fxs files on my linux system.

when I installed 32-bit confd on linux system.
A message “libpam.so.0 is needed to install…” was displayed.

Can I execute 32-bit confd on 64-bit linux system ?


#6

Seems like latest version of ConfD (6.4.2) has version check, so it is not even possible to install

It appears that you are installing a 32-bit ConfD package
on a 64-bit system. Please use the corresponding 64-bit
ConfD package instead.

First you can try if fxs from 64bit version are working for you. If not, you may install 32 bit environment using chroot.


#7

You can run 32-bit confd (and confdc) for Intel, i.e. the i686 version, on your 64-bit Intel system, provided that it has 32-bit support (it typically does). But you obviously can’t execute confd (or confdc) for PPC on your Intel system, regardless of word size. And as @mnovak thought, fxs files are platform independant, so you’re better off installing 64-bit confd for Intel, i.e. the x86_64 version, for building (and using) the fxs files on your 64-bit Intel system.


#8

This check has been there since 64-bit Intel systems first appeared, and users tried to install confd for 32-bit Intel on them, without even knowing that they had a 64-bit system. As noted, confd/confdc will work, but you get very confusing errors when trying the examples, since you would actually need cross-compilation for them. As @joggu already found out, the --force option to the installer overrides the 32-vs-64-bit check, and makes the installer assume that you know what you’re doing…


#9

On Ubuntu, you may also use following command to fix libpam.so.0 message.

sudo apt-get install libpam0g:i386