WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: toolchain setup for piCore11 extension building: how?  (Read 1259 times)

Offline Twist

  • Newbie
  • *
  • Posts: 41
toolchain setup for piCore11 extension building: how?
« on: December 11, 2019, 02:28:16 PM »
I'm having a go at getting a working toolchain setup for building tcz extensions under picore11. But I find myself stuck in a dependency loop. I tried a couple of things (see below) to no avail.
Help appreciated, as are pointers to other sources of info I may have missed.

The 'problem': there's a limited set tcz's under picore11, and I'm missing a couple to to be able to load compiletc. For example mpfr is missing. Compiling mpfr on picore11 is not possible, as gcc needs libmpfr.

Approach #1: borrow and install mpfr.tcz from the 9.x repository on a 11.x box. Result:
Code: (bash) [Select]
tc@box:~$ cat dummy.c ; gcc dummy.c
int main(){}
/usr/local/bin/ld: /usr/local/libexec/gcc/armv7l-unknown-linux-gnueabihf/9.2.0/liblto_plugin.so: error loading plugin: /lib/libpthread.so.0: symbol __twalk_r version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
collect2: error: ld returned 1 exit status

I do not understand that error message (as in: I lack the knowledge to interpret what that means).  My guess is: I can't use the 9.x mpfr on 11.x as it was built for/against a different set of libraries / with different settings.

Approach #2: use the mpfr.build script to compile and create tcz's. I've done that on a 9.x box with the 4.0.2 sources. This creates a libmpfr.so.6 but gcc on 11.x wants libmpfr.so.4. Trying to trick this with a symbolic link doesn't work.

So a couple of questions from me at this point:
1. How do I get to a functional build toolchain on picore11?
2. Should I do approach #2, with an older version of mpfr? (Surely that just recreates the 9.x extension?)
3. How does one in general approach this situation (build stuff for a 'newer' target on an existing host/build). How do I prevent dependencies in newly built packages (e.g. picore11 tcz's) on the used build system (e.g. picore9).
4. Do I need to go down the route of 'cross compiling' even though the hardware is the same? Seems overkill?
5. Is an approach like linux from scratch needed? I.e.: build a 'clean' and 'independent' toolchain, based on the 11.x sources. Seems like overkill?

If there is guidance elsewhere on this subject, I'm very open to reading suggestions!

 

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: toolchain setup for piCore11 extension building: how?
« Reply #1 on: December 11, 2019, 09:29:23 PM »
I will add mpfr to the repo today.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Twist

  • Newbie
  • *
  • Posts: 41
Re: toolchain setup for piCore11 extension building: how?
« Reply #2 on: December 15, 2019, 02:52:51 PM »
Thanks! Using 11beta1a on pi zero w I now have a working build environment.

Working towards a 'complete' compiletc I have submitted 11x versions of (lib)acl, (lib)attr, and patch extensions to picoresubmit _at_ gmail dot com.