OP-TEE / optee_docs

This git contains the official documentation for the OP-TEE project
BSD 2-Clause "Simplified" License
58 stars 96 forks source link

Error when building for Raspberry Pi 3 #101

Closed jarkkojs closed 3 years ago

jarkkojs commented 3 years ago

I get this:

  HOSTLD  scripts/dtc/dtc
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status

GCC:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC) 

Build steps from ~/.bash_history (up until failing):

  532  repo init -u https://github.com/OP-TEE/manifest.git -m  rpi3.xml
  533  repo sync -j4 --no-clone-bundle
  534  cd build
  535  make -j2 toolchains
  536  make 
jarkkojs commented 3 years ago

The other issue I posted distantly relates to this. I.e. would be easy to work around issues like this, if there was way to reset the Git from the default https://github.com/linaro-swg/linux.git

jbech-linaro commented 3 years ago

The other issue I posted distantly relates to this

Oh, I see and unfortunately RPi3 is an exception to what I said in the other thread. For RPi3 we're forced to use the kernel coming from the Raspberry Pi foundation, since they keep lots of patches downstream.

I can see if I can reproduce the issue. I did step up the RPi3 build to a more recent Raspberry Pi foundation kernel a couple of weeks ago and back then I didn't see any build nor regression testing issues. But I'll re-run things in the background to see if anything have sneaked in. I'll keep you posted.

jforissier commented 3 years ago

Looks like an issue with (host) GCC 10, see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.6&id=e33a814e772c. We probably just need to cherry-pick this patch and apply it to our RPi3 branch.

jbech-linaro commented 3 years ago

Looks like an issue with (host) GCC 10, see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.6&id=e33a814e772c. We probably just need to cherry-pick this patch and apply it to our RPi3 branch.

Yes, most likely. I did a full RPi3 for OP-TEE from scratch, no build errors, but my distro uses gcc version 8.3.0 (Debian 8.3.0-6).

@jarkk0sakkinen , since you have another host gcc, do you think you could give a try to cherry-pick the patch Jerome referred to? If that fixes it, then we'll add it to our tree.

jbech-linaro commented 3 years ago

@jarkk0sakkinen , just a reminder, I want to close the ticket at some point, so I'm kindly asking for your help here to what @jforissier suggested.

github-actions[bot] commented 3 years ago

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.