All of lore.kernel.org
 help / color / mirror / Atom feed
* [tpm2] Re: Need help cross compiling tpm2-* for arm
@ 2020-02-19 16:04 pweggler
  0 siblings, 0 replies; 5+ messages in thread
From: pweggler @ 2020-02-19 16:04 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 4764 bytes --]

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


[-- Attachment #2: output.tar.gz --]
[-- Type: application/x-gzip, Size: 31766 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tpm2] Re: Need help cross compiling tpm2-* for arm
@ 2020-02-19 18:38 Tadeusz Struk
  0 siblings, 0 replies; 5+ messages in thread
From: Tadeusz Struk @ 2020-02-19 18:38 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

On 2/19/20 8:04 AM, pweggler(a)jacol.de wrote:
> 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.

-- 
Tadeusz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tpm2] Re: Need help cross compiling tpm2-* for arm
@ 2020-02-19 12:58 Fuchs, Andreas
  0 siblings, 0 replies; 5+ messages in thread
From: Fuchs, Andreas @ 2020-02-19 12:58 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 4385 bytes --]

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tpm2] Re: Need help cross compiling tpm2-* for arm
@ 2020-02-19 11:32 pweggler
  0 siblings, 0 replies; 5+ messages in thread
From: pweggler @ 2020-02-19 11:32 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 3055 bytes --]

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


[-- Attachment #2: output.tar.gz --]
[-- Type: application/x-gzip, Size: 31762 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tpm2] Re: Need help cross compiling tpm2-* for arm
@ 2020-02-19 10:32 Fuchs, Andreas
  0 siblings, 0 replies; 5+ messages in thread
From: Fuchs, Andreas @ 2020-02-19 10:32 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 2650 bytes --]

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-19 18:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19 16:04 [tpm2] Re: Need help cross compiling tpm2-* for arm pweggler
  -- strict thread matches above, loose matches on Subject: below --
2020-02-19 18:38 Tadeusz Struk
2020-02-19 12:58 Fuchs, Andreas
2020-02-19 11:32 pweggler
2020-02-19 10:32 Fuchs, Andreas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.