Skip to contentSkip to conversation

AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging()

DISCUSSION Geoffrey Wossum 2 participants 10 messages Mar 5, 2008 – Mar 10, 2008

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm working on getting OpenEmbeddded to build for an AVR32 system. Right now I'm using an AT32STK1000, although eventually I'll be running on custom hardware.

I've been having problems getting past the uclibc-initial (0.9.28). I get an error when it attempts do_populate_staging(). Here's the error I've been getting.

--begin--
NOTE: package uclibc-initial-0.9.28-r10: task do_populate_staging: started
ERROR: function do_stage failed
ERROR: log data follows (/home/geoff/lrs/playpaq/tmp/work/avr32-angstrom-linux-uclibc/uclibc-initial-0.9.28-r10/temp/log.do_stage.17824)

| make: avr32-angstrom-linux-uclibc-gcc: Command not found
| make: avr32-angstrom-linux-uclibc-gcc: Command not found
| 
+ ./extra/scripts/fix_includes.sh -k /home/geoff/lrs/playpaq/tmp/cross/avr32-angstrom-linux-uclibc -t 
avr32
|
|
| The 
file /home/geoff/lrs/playpaq/tmp/cross/avr32-angstrom-linux-uclibc/Makefile 
or /home/geoff/lrs/playpaq/tmp/cross/avr32-angstrom-linux-uclibc/include/linux/version.h 
is missing!
| Perhaps your kernel source is broken?
|
|
| make: *** [headers] Error 1

NOTE: Task
failed: /home/geoff/lrs/playpaq/tmp/work/avr32-angstrom-linux-uclibc/uclibc-initial-0.9.28-r10/temp/log.do_stage.17824
NOTE: package uclibc-initial-0.9.28-r10: task do_populate_staging: failed
ERROR: TaskFailed event exception, aborting
NOTE: package uclibc-initial-0.9.28: failed
--end--

I was able to get past this by modifying uclibc_0.9.28.bb so that KERNEL_SOURCE is now getting to what I think is correct. It was:
KERNEL_SOURCE = "${CROSS_DIR}/${TARGET_SYS}"
and I changed it to:
KERNEL_SOURCE = "${STAGING_DIR_HOST}/${exec_prefix}"

It also looks like I could have re-enabled the nokernelheader.patch. Any comments on what the "proper" fix is here?

With that change made, the do_populate_staging went further, but not much further. In uclibc-initial_0.9.28.bb, there is the following command:

	make PREFIX= DEVEL_PREFIX=${UCLIBC_PREFIX}/ \
		RUNTIME_PREFIX=${UCLIBC_PREFIX}/ \
		pregen install_dev

UCLIBC_PREFIX used to be defined in uclibc.inc, but that was changed about a week ago. Changing uclibc-initial_0.9.28.bb to use UCLIBC_STAGING_PREFIX instead of UCLIBC_PREFIX got me past this issue. Any comments about the "correct" fix here?

Thanks,
---
Geoffrey

#1 lore raw

Hi,

Quoted 7 lines · Geoffrey Wossum

I'm working on getting OpenEmbeddded to build for an AVR32 system. Right now I'm using an AT32STK1000, although eventually I'll be running on custom hardware.

I've been having problems getting past the uclibc-initial (0.9.28). I get an error when it attempts do_populate_staging(). Here's the error I've been getting.

I think both your fixes are correct. Those changes were already made in poky but had got lost somewhere between there and OE.dev, I'll sync them up. Thanks for the report and let us know if anything doesn't work after I merge them.

Cheers,

Richard

#2 lore raw

Re: AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging ()

Quoted 5 lines · Richard Purdie
Quoted 4 lines · Geoffrey Wossum

I'm working on getting OpenEmbeddded to build for an AVR32 system. Right now I'm using an AT32STK1000, although eventually I'll be running on custom hardware.

Quoted 8 lines
Quoted 3 lines

I've been having problems getting past the uclibc-initial (0.9.28). I get an error when it attempts do_populate_staging(). Here's the error I've been getting.

I think both your fixes are correct. Those changes were already made in poky but had got lost somewhere between there and OE.dev, I'll sync them up. Thanks for the report and let us know if anything doesn't work after I merge them.

I ended up getting an error much later on in the build process, while executing do_install() for uclibc (0.9.28). ld couldn't find crt1.o while executing the "make install_dev install_runtime" step. ld wants crt1.o in the cross directory. Sorry, didn't save the exact error message.

I got around this by defining UCLIBC_PREFIX to what it was before ("${CROSS_DIR}/${TARGET_SYS}"), and then adding the following to the top of uclibc.inc's do_install():

	oe_runmake PREFIX= DEVEL_PREFIX=${UCLIBC_STAGE_PREFIX}/ \
		RUNTIME_PREFIX=${UCLIBC_STAGE_PREFIX}/ \
		install_dev install_runtime

This is essentially what was there before. With this in place, I get much further.

It almost feels like the patch a week ago to uclibc.inc needed some patches to binutils-cross or something to go with it...

Now the build stopped while building ncurses-native_5.4. Patch didn't apply properly...

---
Geoffrey

#3 lore raw

Re: AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging ()

Quoted 29 lines · Geoffrey Wossum
Quoted 5 lines · Richard Purdie
Quoted 4 lines · Geoffrey Wossum

I'm working on getting OpenEmbeddded to build for an AVR32 system. Right now I'm using an AT32STK1000, although eventually I'll be running on custom hardware.

Quoted 8 lines
Quoted 3 lines

I've been having problems getting past the uclibc-initial (0.9.28). I get an error when it attempts do_populate_staging(). Here's the error I've been getting.

I think both your fixes are correct. Those changes were already made in poky but had got lost somewhere between there and OE.dev, I'll sync them up. Thanks for the report and let us know if anything doesn't work after I merge them.

I ended up getting an error much later on in the build process, while executing do_install() for uclibc (0.9.28). ld couldn't find crt1.o while executing the "make install_dev install_runtime" step. ld wants crt1.o in the cross directory. Sorry, didn't save the exact error message.

I got around this by defining UCLIBC_PREFIX to what it was before ("${CROSS_DIR}/${TARGET_SYS}"), and then adding the following to the top of uclibc.inc's do_install():

	oe_runmake PREFIX= DEVEL_PREFIX=${UCLIBC_STAGE_PREFIX}/ \
		RUNTIME_PREFIX=${UCLIBC_STAGE_PREFIX}/ \
		install_dev install_runtime
Quoted 8 lines

This is essentially what was there before. With this in place, I get much further.

It almost feels like the patch a week ago to uclibc.inc needed some patches to binutils-cross or something to go with it...

Now the build stopped while building ncurses-native_5.4. Patch didn't apply properly...

Which distro and machine are you using? This sounds like something which isn't using sysroot or the sysroot workarounds.

Poking around cross hasn't been needed for a while and instead of the above, building "cross-linkage" might help. This was removed from the linux-libc-headers DEPENDS recently. You may also need "staging-linkage", it all depends on the compiler though and if its sysroot capable, enabling that would be infinitely preferable.

Regards,

Richard

#4 lore raw

Re: AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging ()

Quoted 2 lines · Richard Purdie

Which distro and machine are you using? This sounds like something which isn't using sysroot or the sysroot workarounds.

Distro: angstrom-2008.1
Machine: at32stk1000 (AVR32)

It's using binutils-2.17, gcc-4.1.2-atmel.1.1.0, uClibc-0.9.28.

I'll investigate whether this compiler is sysroot capable. Looking at the log of configuring binutils and gcc, it was built using --sysroot
and --with-build-sysroot. There's an AVR32 binutils patch that does something to sysroot handling, though. I'll have to look at it more to figure out what they were trying to do. I'll bet this has something to do with my problem.

Thanks!
---
Geoffrey

#9 lore raw

Re: AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging ()

In reply to Richard Purdie
Quoted 7 lines · Richard Purdie

Hi,

Quoted 4 lines · Geoffrey Wossum

I'm working on getting OpenEmbeddded to build for an AVR32 system. Right now I'm using an AT32STK1000, although eventually I'll be running on custom hardware.

Quoted 8 lines
Quoted 3 lines

I've been having problems getting past the uclibc-initial (0.9.28). I get an error when it attempts do_populate_staging(). Here's the error I've been getting.

I think both your fixes are correct. Those changes were already made in poky but had got lost somewhere between there and OE.dev, I'll sync them up. Thanks for the report and let us know if anything doesn't work after I merge them.

Just pulled this patch out of monotone.

uclibc.inc defines UCLIBC_STAGE_PREFIX, which is what uclibc-initial_0.9.29.bb references. The other uclibc-initial_0.9.*.bb files reference UCLIBC_STAGING_PREFIX, though. Changing it to UCLIBC_STAGE_PREFIX in uclibc-initial_0.9.28.bb fixes this for me.

---
Geoffrey

#5 lore raw

Re: AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging ()

In reply to Richard Purdie
Quoted 8 lines · Richard Purdie

Which distro and machine are you using? This sounds like something which isn't using sysroot or the sysroot workarounds.

Poking around cross hasn't been needed for a while and instead of the above, building "cross-linkage" might help. This was removed from the linux-libc-headers DEPENDS recently. You may also need "staging-linkage", it all depends on the compiler though and if its sysroot capable, enabling that would be infinitely preferable.

So much for blaming Atmel for their ld patch. I think I found the REAL problem.

Checking the log.do_configure for gcc-cross-initial, --with-sysroot was NOT getting passed to gcc's configure script.

So I started parsing gcc-cross-initial_4.1.2.bb by hand. Here's what it looks like is happening to me. Eventually, gcc3-build-cross.inc gets required in. This file will set EXTRA_OECONF to have the "--with-sysroot" option. But a little later, gcc-cross-initial.inc gets required in. This file resets EXTRA_OECONF, so the "--with-sysroot" option added by gcc3-build-cross.inc gets lost.

I attempted to just swap the order of "require gcc-cross_${PV}.bb" and "require gcc-cross-initial.inc" in gcc-cross-initial_4.1.2.bb. Doing a "bitbake -c rebuild gcc-cross-initial" built the gcc-cross-initial with the proper "--with-sysroot" option. Hooray! But then when I tried to resume building the image, this swap made the overall build system think that "avr32-gcc-initial-4.1.2" wasn't available. Back to the drawing board.

So then I changed gcc-cross-initial.inc to append onto EXTRA_OECONF instead of setting EXTRA_OECONF. This seems to work for me now, although I don't know what other implications this change may have.

Comments?

---
Geoffrey

#6 lore raw

Re: AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging ()

Quoted 17 lines · Geoffrey Wossum

Checking the log.do_configure for gcc-cross-initial, --with-sysroot was NOT getting passed to gcc's configure script.

So I started parsing gcc-cross-initial_4.1.2.bb by hand. Here's what it looks like is happening to me. Eventually, gcc3-build-cross.inc gets required in. This file will set EXTRA_OECONF to have the "--with-sysroot" option. But a little later, gcc-cross-initial.inc gets required in. This file resets EXTRA_OECONF, so the "--with-sysroot" option added by gcc3-build-cross.inc gets lost.

I attempted to just swap the order of "require gcc-cross_${PV}.bb" and "require gcc-cross-initial.inc" in gcc-cross-initial_4.1.2.bb. Doing a "bitbake -c rebuild gcc-cross-initial" built the gcc-cross-initial with the proper "--with-sysroot" option. Hooray! But then when I tried to resume building the image, this swap made the overall build system think that "avr32-gcc-initial-4.1.2" wasn't available. Back to the drawing board.

Quoted 3 lines

So then I changed gcc-cross-initial.inc to append onto EXTRA_OECONF instead of setting EXTRA_OECONF. This seems to work for me now, although I don't know what other implications this change may have.

I was meaning to ask what changed you'd have to make to get your image to build.

By strange coincidence I was looking at gcc-cross-initial today and wondered about this. I concluded that gcc-cross-initial does not need sysroot support though. gcc-cross-initial is only used to build the libc for gcc-cross "proper" and for that you don't need anything in staging.

So the question is why would gcc-cross-initial need to find things in staging?

Cheers,

Richard

#7 lore raw

Re: AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging ()

Quoted 6 lines · Richard Purdie
Quoted 1 line · Geoffrey Wossum

Checking the log.do_configure for gcc-cross-initial, --with-sysroot was

I was meaning to ask what changed you'd have to make to get your image to build.

Quoted 7 lines

By strange coincidence I was looking at gcc-cross-initial today and wondered about this. I concluded that gcc-cross-initial does not need sysroot support though. gcc-cross-initial is only used to build the libc for gcc-cross "proper" and for that you don't need anything in staging.

So the question is why would gcc-cross-initial need to find things in staging?

I'm using currently uClibc 0.9.28. glibc doesn't currently support the AVR32. It's during uclibc-initial-0.9.28's do_populate_staging() step that this whole sysroot issue pops up. Something about that step causes something to get linked, and that's when you the problem occurs. I recreated the problem today. Should have saved the log.

Maybe uClibc 0.9.29 fixes this issue. I need to move to it anyway. Koen suggested it as a fix for my init segfault issue, plus I think avahi needs it, and I need avahi in my final product.

It looks like Atmel's AVR32 patches for uClibc 0.9.29 are already in OpenEmbedded. Looks like I just need to create a uClibc.machine file for the AVR32. I'll try out building against uClibc 0.9.29 on Monday.

---
Geoffrey

#8 lore raw

Re: AVR32 + OpenEmbedded: Problems with uclibc-initial do_populate_staging ()

Quoted 12 lines · Geoffrey Wossum
Quoted 11 lines · Richard Purdie
Quoted 1 line · Geoffrey Wossum

Checking the log.do_configure for gcc-cross-initial, --with-sysroot was

I was meaning to ask what changed you'd have to make to get your image to build.

By strange coincidence I was looking at gcc-cross-initial today and wondered about this. I concluded that gcc-cross-initial does not need sysroot support though. gcc-cross-initial is only used to build the libc for gcc-cross "proper" and for that you don't need anything in staging.

Quoted 6 lines
Quoted 2 lines

So the question is why would gcc-cross-initial need to find things in staging?

Maybe uClibc 0.9.29 fixes this issue. I need to move to it anyway. Koen suggested it as a fix for my init segfault issue, plus I think avahi needs it, and I need avahi in my final product.

uClibc 0.9.29 does indeed fix these strange build issues I was having. I can build everything with uClibc 0.9.29 without any mods to the files in packages/gcc. So that's good.

Still getting the segfault when init starts up, though.

---
Geoffrey