Skip to contentSkip to conversation

New: Shared C++ libraries for Microblaze results in Segmentation Fault

Buildroot bugzilla at busybox.net 1 participant 6 messages Sep 14, 2016 – Feb 26, 2017

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=9251

Bug ID: 9251
Summary: Shared C++ libraries for Microblaze results in
Segmentation Fault
Product: buildroot
Version: 2016.08
Hardware: Other
OS: Linux
Status: NEW
Severity: major
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: scotttimothye at johndeere.com
CC: buildroot at uclibc.org
Target Milestone: ---

It appears that enabling C++ and shared libraries does not work for Microblaze targets. When a simple Hello World C++ application is executed, it results in a Segmentation Fault. This occurs before any code in the app is executed (presumably the fault is occurring in the libstdc++ startup code.)

Host environment: Linux Mint 15, 32-bit x86 platform. wbx has also replicated it on an x86_64 system with similar results.

Steps to reproduce using buildroot git hash
ed5604ed9e378c3f8814d7f92ec66fd855b8245c:

1) make qemu_microblazeel_mmu_defconfig
2) make menuconfig
- Toolchain: enable C++ support
3) make
4) cat > hello.cpp
int main(void){}
5) output/host/usr/bin/microblazeel-linux-g++ hello.cpp -o output/target/root/hello
6) make
7) Running qemu 2.5.1.1:
qemu-system-microblazeel -M petalogix-s3adsp1800 -serial stdio -kernel output/images/linux.bin
8) Let the system boot. Login w/password "root"
9) ./hello
-> Segmentation Fault.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 9251] Shared C++ libraries for Microblaze results in Segmentation Fault

https://bugs.busybox.net/show_bug.cgi?id=9251

--- Comment #1 from scotttimothye at johndeere.com ---
If you follow up the previous steps by defining "static-only" libraries, then the C++ app works:

1) make menuconfig
2) Build Options > Libraries > static only
3) make clean
4) (See previous steps for build steps)
5) ./hello
-> No seg fault

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 9251] Shared C++ libraries for Microblaze results in Segmentation Fault

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=9251

--- Comment #2 from Thomas Petazzoni <[email protected]> --- Waldemar has identified that this is a regression between binutils 2.25 and binutils 2.26. I.e, with binutils 2.25, C++ programs linked dynamically work fine on Microblaze. Starting with binutils 2.26, they no longer work.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 9251] Shared C++ libraries for Microblaze results in Segmentation Fault

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=9251

--- Comment #3 from scotttimothye at johndeere.com ---
Changing to binutils 2.25 does not correct the problem. I just repeated the original steps below, altering step 2) to include selection of binutils 2.25.1 during the menuconfig. Further, I also enabled Host Utilities > host qemu > Enable system emulation.

I built everything from scratch against the latest Buildroot repo (446debc47ef42db10e96973355f441da7685929a) and launched qemu (Buildroot built v2.7.0). Trying to run the simple ./hello program resulted in a segmentation fault.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#4 lore raw

[Buildroot] [Bug 9251] Shared C++ libraries for Microblaze results in Segmentation Fault

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=9251

--- Comment #4 from scotttimothye at johndeere.com --- (In reply to scotttimothye from comment #3)

Just to clarify comment #3, it should read "I just repeated the original steps," rather than "I just repeated the original steps below,"

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#5 lore raw

[Buildroot] [Bug 9251] Shared C++ libraries for Microblaze results in Segmentation Fault

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=9251

mail at waldemar-brodkorb.de changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #5 from mail at waldemar-brodkorb.de --- I checked with master on x86_64 host.
With gcc 5.x and binutils 2.25.1/2.26.1/2.27. I couldn't reproduce the segfault anymore.

So may be reopen it with exact version of buildroot, gcc, binutils and C library used. And if it is happening on x86 or x86_64 host.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.