Skip to contentSkip to conversation

Need help cross compiling tpm2-* for arm

tpm2 pweggler at jacol.de 2 participants 6 messages Feb 19, 2020

lore
Share & tools
lore

pweggler at jacol.de

#0 lore raw

Hello,

I’m failing to crosscompile the tpm2-tss-engine. The build fails with “/usr/bin/ld: cannot find -ltss2-mu”. Can you provide me with an instruction or howto guide? I’m not sure if even the cross compilation is successful at all. Is there a way to explicitly specify the compiler path?

My steps so far:
I’m using ubuntu 18.04 LTS
I have cloned all github repos into a directory tpm2 tpm2

├── tpm2-abrmd
├── tpm2-tools
├── tpm2-tss
├── tpm2-tss-engine
└── tpm2-tss_orig

In the tpm2-tss folder:
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi make -j$(nproc)

After this has succeeded
In the tpm2-tss-engine folder:
TPM2TSS=../tpm2-tss
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=${TPM2TSS}/lib:$PKG_CONFIG_PATH CFLAGS=-I${TPM2TSS}/include LDFLAGS=-L${TPM2TSS}/src/tss2-{tcti,mu,sys,esys}/.libs make -j$(nproc)

the complete error is:
CCLD libtpm2tss.la
/usr/bin/ld: cannot find -ltss2-mu /usr/bin/ld: cannot find -ltss2-tctildr
collect2: error: ld returned 1 exit status Makefile:854: recipe for target 'libtpm2tss.la' failed
make: *** [libtpm2tss.la] Error 1

I have attached the output from both configure and make runs.

With kind regards
Patrick Weggler

B.Sc Informatik
Entwicklung

--------------------------------------------------------------------------------
JacoL – FPGA Entwicklungen GmbH
Hörvelsinger Weg 27
89081 Ulm-Jungingen
Deutschland
Mail: pweggler(a)jacol.de
Büro: 0731 / 20649331
Mobil: 0171 / 2067034
Fax: 0731 / 397 69 155
------------------------------------------------------------------------
Registergericht Ulm, HRB 734013
Umsatzsteueridentifikationsnummer DE276321495

Geschäftsführung:
Florian Jablonska

Hiermit widerspreche ich ausdrücklich jeglicher Nutzung oder Übermittlung meiner Daten, gleichgültig, zu welchen Zwecken oder an welchen Empfänger sie erfolgt. Insbesondere widerspreche ich der Nutzung oder Übermittlung meiner Daten für Werbe, Markt- oder Meinungsforschungszwecken gemäß § 28 Absatz 3 Bundesdatenschutzgesetz

#1 lore raw

First, try to run

make V=1

that will enable verbose output. There we can have a look if the LDFLAGS for the paths were correctly forwarded to the make target.

Then we can take it from there.
________________________________________
From: pweggler(a)jacol.de [pweggler(a)jacol.de]
Sent: Wednesday, February 19, 2020 11:29
To: tpm2(a)lists.01.org
Subject: [tpm2] Need help cross compiling tpm2-* for arm

Hello,

I’m failing to crosscompile the tpm2-tss-engine. The build fails with “/usr/bin/ld: cannot find -ltss2-mu”. Can you provide me with an instruction or howto guide? I’m not sure if even the cross compilation is successful at all. Is there a way to explicitly specify the compiler path?

My steps so far:
I’m using ubuntu 18.04 LTS
I have cloned all github repos into a directory tpm2 tpm2

├── tpm2-abrmd
├── tpm2-tools
├── tpm2-tss
├── tpm2-tss-engine
└── tpm2-tss_orig

In the tpm2-tss folder:
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi make -j$(nproc)

After this has succeeded
In the tpm2-tss-engine folder:
TPM2TSS=../tpm2-tss
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=${TPM2TSS}/lib:$PKG_CONFIG_PATH CFLAGS=-I${TPM2TSS}/include LDFLAGS=-L${TPM2TSS}/src/tss2-{tcti,mu,sys,esys}/.libs make -j$(nproc)

the complete error is:
CCLD libtpm2tss.la
/usr/bin/ld: cannot find -ltss2-mu /usr/bin/ld: cannot find -ltss2-tctildr
collect2: error: ld returned 1 exit status Makefile:854: recipe for target 'libtpm2tss.la' failed
make: *** [libtpm2tss.la] Error 1

I have attached the output from both configure and make runs.

With kind regards
Patrick Weggler

B.Sc Informatik
Entwicklung

--------------------------------------------------------------------------------
JacoL – FPGA Entwicklungen GmbH
Hörvelsinger Weg 27
89081 Ulm-Jungingen
Deutschland
Mail: pweggler(a)jacol.de
Büro: 0731 / 20649331
Mobil: 0171 / 2067034
Fax: 0731 / 397 69 155
------------------------------------------------------------------------
Registergericht Ulm, HRB 734013
Umsatzsteueridentifikationsnummer DE276321495

Geschäftsführung:
Florian Jablonska

Hiermit widerspreche ich ausdrücklich jeglicher Nutzung oder Übermittlung meiner Daten, gleichgültig, zu welchen Zwecken oder an welchen Empfänger sie erfolgt. Insbesondere widerspreche ich der Nutzung oder Übermittlung meiner Daten für Werbe, Markt- oder Meinungsforschungszwecken gemäß § 28 Absatz 3 Bundesdatenschutzgesetz

#2 lore raw

Thank you for the instant reply! See both outputs attached.

(this is a resend with compressed logs. The uncompressed logs are exceeding the 400kb limit)

-----Ursprüngliche Nachricht-----
Von: Fuchs, Andreas <andreas.fuchs(a)sit.fraunhofer.de>
Gesendet: Wednesday, February 19, 2020 11:32 AM
An: pweggler(a)jacol.de; tpm2(a)lists.01.org
Betreff: RE: Need help cross compiling tpm2-* for arm

First, try to run

make V=1

that will enable verbose output. There we can have a look if the LDFLAGS for the paths were correctly forwarded to the make target.

Then we can take it from there.
________________________________________
From: pweggler(a)jacol.de [pweggler(a)jacol.de]
Sent: Wednesday, February 19, 2020 11:29
To: tpm2(a)lists.01.org
Subject: [tpm2] Need help cross compiling tpm2-* for arm

Hello,

I’m failing to crosscompile the tpm2-tss-engine. The build fails with “/usr/bin/ld: cannot find -ltss2-mu”. Can you provide me with an instruction or howto guide? I’m not sure if even the cross compilation is successful at all. Is there a way to explicitly specify the compiler path?

My steps so far:
I’m using ubuntu 18.04 LTS
I have cloned all github repos into a directory tpm2 tpm2

├── tpm2-abrmd
├── tpm2-tools
├── tpm2-tss
├── tpm2-tss-engine
└── tpm2-tss_orig

In the tpm2-tss folder:
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi make -j$(nproc)

After this has succeeded
In the tpm2-tss-engine folder:
TPM2TSS=../tpm2-tss
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=${TPM2TSS}/lib:$PKG_CONFIG_PATH CFLAGS=-I${TPM2TSS}/include LDFLAGS=-L${TPM2TSS}/src/tss2-{tcti,mu,sys,esys}/.libs make -j$(nproc)

the complete error is:
CCLD libtpm2tss.la
/usr/bin/ld: cannot find -ltss2-mu /usr/bin/ld: cannot find -ltss2-tctildr
collect2: error: ld returned 1 exit status Makefile:854: recipe for target 'libtpm2tss.la' failed
make: *** [libtpm2tss.la] Error 1

I have attached the output from both configure and make runs.

With kind regards
Patrick Weggler

B.Sc Informatik
Entwicklung

--------------------------------------------------------------------------------
JacoL – FPGA Entwicklungen GmbH
Hörvelsinger Weg 27
89081 Ulm-Jungingen
Deutschland
Mail: pweggler(a)jacol.de
Büro: 0731 / 20649331
Mobil: 0171 / 2067034
Fax: 0731 / 397 69 155
------------------------------------------------------------------------
Registergericht Ulm, HRB 734013
Umsatzsteueridentifikationsnummer DE276321495

Geschäftsführung:
Florian Jablonska

Hiermit widerspreche ich ausdrücklich jeglicher Nutzung oder Übermittlung meiner Daten, gleichgültig, zu welchen Zwecken oder an welchen Empfänger sie erfolgt. Insbesondere widerspreche ich der Nutzung oder Übermittlung meiner Daten für Werbe, Markt- oder Meinungsforschungszwecken gemäß § 28 Absatz 3 Bundesdatenschutzgesetz

#3 lore raw

If you look at the tpm2-tss-engine output, you'll notice only -L../tpm2-tss/src/tss2-esys/.libs
The -L../tpm2-tss/src/tss2-sys/.libs -L../tpm2-tss/src/tss2-mu/.libs and -L../tpm2-tss/src/tss2-tcti/.libs are missing.

And I think I understand why.
On you ./configure call, the {tcti,mu,...} will expand into several version iterations of LDFLAGS.

see:

$ echo ./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=${TPM2TSS}/lib:$PKG_CONFIG_PATH CFLAGS=-I${TPM2TSS}/include LDFLAGS=-L${TPM2TSS}/src/tss2-{tcti,mu,sys,esys}/.libs
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=/lib:/.../lib/pkgconfig CFLAGS=-I/include LDFLAGS=-L/src/tss2-tcti/.libs LDFLAGS=-L/src/tss2-mu/.libs LDFLAGS=-L/src/tss2-sys/.libs LDFLAGS=-L/src/tss2-esys/.libs

Only the last LDFLAGS will be honored...

I'm afraid you will have to do the LDFLAGS manually, without bash-expansion of {mu,sys,esys} Also remember to set it into "" so they are treated as one argument...

Good luck,
Andreas
________________________________________
From: pweggler(a)jacol.de [pweggler(a)jacol.de]
Sent: Wednesday, February 19, 2020 12:32
To: tpm2(a)lists.01.org
Subject: [tpm2] Re: Need help cross compiling tpm2-* for arm

Thank you for the instant reply! See both outputs attached.

(this is a resend with compressed logs. The uncompressed logs are exceeding the 400kb limit)

-----Ursprüngliche Nachricht-----
Von: Fuchs, Andreas <andreas.fuchs(a)sit.fraunhofer.de>
Gesendet: Wednesday, February 19, 2020 11:32 AM
An: pweggler(a)jacol.de; tpm2(a)lists.01.org
Betreff: RE: Need help cross compiling tpm2-* for arm

First, try to run

make V=1

that will enable verbose output. There we can have a look if the LDFLAGS for the paths were correctly forwarded to the make target.

Then we can take it from there.
________________________________________
From: pweggler(a)jacol.de [pweggler(a)jacol.de]
Sent: Wednesday, February 19, 2020 11:29
To: tpm2(a)lists.01.org
Subject: [tpm2] Need help cross compiling tpm2-* for arm

Hello,

I’m failing to crosscompile the tpm2-tss-engine. The build fails with “/usr/bin/ld: cannot find -ltss2-mu”. Can you provide me with an instruction or howto guide? I’m not sure if even the cross compilation is successful at all. Is there a way to explicitly specify the compiler path?

My steps so far:
I’m using ubuntu 18.04 LTS
I have cloned all github repos into a directory tpm2 tpm2

├── tpm2-abrmd
├── tpm2-tools
├── tpm2-tss
├── tpm2-tss-engine
└── tpm2-tss_orig

In the tpm2-tss folder:
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi make -j$(nproc)

After this has succeeded
In the tpm2-tss-engine folder:
TPM2TSS=../tpm2-tss
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=${TPM2TSS}/lib:$PKG_CONFIG_PATH CFLAGS=-I${TPM2TSS}/include LDFLAGS=-L${TPM2TSS}/src/tss2-{tcti,mu,sys,esys}/.libs make -j$(nproc)

the complete error is:
CCLD libtpm2tss.la
/usr/bin/ld: cannot find -ltss2-mu /usr/bin/ld: cannot find -ltss2-tctildr
collect2: error: ld returned 1 exit status Makefile:854: recipe for target 'libtpm2tss.la' failed
make: *** [libtpm2tss.la] Error 1

I have attached the output from both configure and make runs.

With kind regards
Patrick Weggler

B.Sc Informatik
Entwicklung

--------------------------------------------------------------------------------
JacoL – FPGA Entwicklungen GmbH
Hörvelsinger Weg 27
89081 Ulm-Jungingen
Deutschland
Mail: pweggler(a)jacol.de
Büro: 0731 / 20649331
Mobil: 0171 / 2067034
Fax: 0731 / 397 69 155
------------------------------------------------------------------------
Registergericht Ulm, HRB 734013
Umsatzsteueridentifikationsnummer DE276321495

Geschäftsführung:
Florian Jablonska

Hiermit widerspreche ich ausdrücklich jeglicher Nutzung oder Übermittlung meiner Daten, gleichgültig, zu welchen Zwecken oder an welchen Empfänger sie erfolgt. Insbesondere widerspreche ich der Nutzung oder Übermittlung meiner Daten für Werbe, Markt- oder Meinungsforschungszwecken gemäß § 28 Absatz 3 Bundesdatenschutzgesetz

#4 lore raw

Thank you! It compiles now, but the filetype of .libs/ libtpm2tss.so is ELF x86-64 instead of the expected arm

Greetings
Patrick

-----Ursprüngliche Nachricht-----
Von: Fuchs, Andreas <andreas.fuchs(a)sit.fraunhofer.de>
Gesendet: Wednesday, February 19, 2020 1:58 PM
An: pweggler(a)jacol.de; tpm2(a)lists.01.org
Betreff: RE: Need help cross compiling tpm2-* for arm

If you look at the tpm2-tss-engine output, you'll notice only -L../tpm2-tss/src/tss2-esys/.libs The -L../tpm2-tss/src/tss2-sys/.libs -L../tpm2-tss/src/tss2-mu/.libs and -L../tpm2-tss/src/tss2-tcti/.libs are missing.

And I think I understand why.
On you ./configure call, the {tcti,mu,...} will expand into several version iterations of LDFLAGS.

see:

$ echo ./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=${TPM2TSS}/lib:$PKG_CONFIG_PATH CFLAGS=-I${TPM2TSS}/include LDFLAGS=-L${TPM2TSS}/src/tss2-{tcti,mu,sys,esys}/.libs
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=/lib:/.../lib/pkgconfig CFLAGS=-I/include LDFLAGS=-L/src/tss2-tcti/.libs LDFLAGS=-L/src/tss2-mu/.libs LDFLAGS=-L/src/tss2-sys/.libs LDFLAGS=-L/src/tss2-esys/.libs

Only the last LDFLAGS will be honored...

I'm afraid you will have to do the LDFLAGS manually, without bash-expansion of {mu,sys,esys} Also remember to set it into "" so they are treated as one argument...

Good luck,
Andreas
________________________________________
From: pweggler(a)jacol.de [pweggler(a)jacol.de]
Sent: Wednesday, February 19, 2020 12:32
To: tpm2(a)lists.01.org
Subject: [tpm2] Re: Need help cross compiling tpm2-* for arm

Thank you for the instant reply! See both outputs attached.

(this is a resend with compressed logs. The uncompressed logs are exceeding the 400kb limit)

-----Ursprüngliche Nachricht-----
Von: Fuchs, Andreas <andreas.fuchs(a)sit.fraunhofer.de>
Gesendet: Wednesday, February 19, 2020 11:32 AM
An: pweggler(a)jacol.de; tpm2(a)lists.01.org
Betreff: RE: Need help cross compiling tpm2-* for arm

First, try to run

make V=1

that will enable verbose output. There we can have a look if the LDFLAGS for the paths were correctly forwarded to the make target.

Then we can take it from there.
________________________________________
From: pweggler(a)jacol.de [pweggler(a)jacol.de]
Sent: Wednesday, February 19, 2020 11:29
To: tpm2(a)lists.01.org
Subject: [tpm2] Need help cross compiling tpm2-* for arm

Hello,

I’m failing to crosscompile the tpm2-tss-engine. The build fails with “/usr/bin/ld: cannot find -ltss2-mu”. Can you provide me with an instruction or howto guide? I’m not sure if even the cross compilation is successful at all. Is there a way to explicitly specify the compiler path?

My steps so far:
I’m using ubuntu 18.04 LTS
I have cloned all github repos into a directory tpm2 tpm2

├── tpm2-abrmd
├── tpm2-tools
├── tpm2-tss
├── tpm2-tss-engine
└── tpm2-tss_orig

In the tpm2-tss folder:
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi make -j$(nproc)

After this has succeeded
In the tpm2-tss-engine folder:
TPM2TSS=../tpm2-tss
./bootstrap
./configure --build=i686-pc-linux-gnu --host=arm-oe-linux-gnueabi --target=arm-oe-linux-gnueabi PKG_CONFIG_PATH=${TPM2TSS}/lib:$PKG_CONFIG_PATH CFLAGS=-I${TPM2TSS}/include LDFLAGS=-L${TPM2TSS}/src/tss2-{tcti,mu,sys,esys}/.libs make -j$(nproc)

the complete error is:
CCLD libtpm2tss.la
/usr/bin/ld: cannot find -ltss2-mu /usr/bin/ld: cannot find -ltss2-tctildr
collect2: error: ld returned 1 exit status Makefile:854: recipe for target 'libtpm2tss.la' failed
make: *** [libtpm2tss.la] Error 1

I have attached the output from both configure and make runs.

With kind regards
Patrick Weggler

B.Sc Informatik
Entwicklung

--------------------------------------------------------------------------------
JacoL – FPGA Entwicklungen GmbH
Hörvelsinger Weg 27
89081 Ulm-Jungingen
Deutschland
Mail: pweggler(a)jacol.de
Büro: 0731 / 20649331
Mobil: 0171 / 2067034
Fax: 0731 / 397 69 155
------------------------------------------------------------------------
Registergericht Ulm, HRB 734013
Umsatzsteueridentifikationsnummer DE276321495

Geschäftsführung:
Florian Jablonska

Hiermit widerspreche ich ausdrücklich jeglicher Nutzung oder Übermittlung meiner Daten, gleichgültig, zu welchen Zwecken oder an welchen Empfänger sie erfolgt. Insbesondere widerspreche ich der Nutzung oder Übermittlung meiner Daten für Werbe, Markt- oder Meinungsforschungszwecken gemäß § 28 Absatz 3 Bundesdatenschutzgesetz

#5 lore raw
Quoted 1 line · pweggler(a)jacol.de

Thank you! It compiles now, but the filetype of .libs/ libtpm2tss.so is ELF x86-64 instead of the expected arm

You can also pass in the standard --prefix=<dir> when you ./configure the TSS libraries and then do "make install".That is the easiest and proffered way.
WRT the so being ELF x86-64 make sure that you set the $CC and other tools are set to the cross-compiler.

Signature · 1 line
Tadeusz