Graeme Smecher | 12 Jul 2011 17:39

[microblaze-linux] Linker bug with -O2 on sqlite

Hi all,

I mentioned this bug to John some time back, but here's a complete 
report. I'm using the stock xldk 2.0 big-endian release 
(git://git.xilinx.com/xldk/microblaze_v2.0.git) from earlier this year.

Symptoms:

     * running sqlite3 produces segmentation fault. With LD_DEBUG=all, 
the last lines are e.g.:

         143:     relocation processing: /tmp/libsqlite3.so.0.8.6
         Segmentation fault

To reproduce:

     * download and unpack 
http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
     * ./configure --prefix=/usr CC=microblaze-unknown-linux-gnu-gcc 
LD=microblaze-unknown-linux-gnu-ld CFLAGS="-O0 -mxl-barrel-shift 
-mno-xl-soft-mul -mno-xl-soft-div -msmall-divides -mxl-multiply-high 
-mxl-pattern-compare -mcpu=v8.00.b" --build=x86_64-linux-gnu 
--host=microblaze-unknown-linux-gnu
     * make
     * run ./sqlite3 on the board. If it gets to a "sqlite>" prompt 
without segfaulting, it worked.

To generate a working build:

     * replace -O2 with -O0 in the ./configure step. (-O1 fails too.)
(Continue reading)

John Williams | 18 Jul 2011 07:25
Favicon

Re: [microblaze-linux] Linker bug with -O2 on sqlite

Hi Graeme,


Thanks for the test-case.  We expect to be starting some intensive toolchain work in the near future, updating the toolchains to current versions, getting all MicroBlaze binutils/gcc upstream etc.  So, we will include your test case in that work, and hopefully the solution to this issue will come out in the wash.  It will hopefully be a simple matter for you to backport the solution to the older release if you want, or even better just start using the products of our labor and enjoy a more modern toolchain!

Regards,

John

On Wed, Jul 13, 2011 at 1:39 AM, Graeme Smecher <gsmecher <at> threespeedlogic.com> wrote:
Hi all,

I mentioned this bug to John some time back, but here's a complete
report. I'm using the stock xldk 2.0 big-endian release
(git://git.xilinx.com/xldk/microblaze_v2.0.git) from earlier this year.

Symptoms:

    * running sqlite3 produces segmentation fault. With LD_DEBUG=all,
the last lines are e.g.:

        143:     relocation processing: /tmp/libsqlite3.so.0.8.6
        Segmentation fault

To reproduce:

    * download and unpack
http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
    * ./configure --prefix=/usr CC=microblaze-unknown-linux-gnu-gcc
LD=microblaze-unknown-linux-gnu-ld CFLAGS="-O0 -mxl-barrel-shift
-mno-xl-soft-mul -mno-xl-soft-div -msmall-divides -mxl-multiply-high
-mxl-pattern-compare -mcpu=v8.00.b" --build=x86_64-linux-gnu
--host=microblaze-unknown-linux-gnu
    * make
    * run ./sqlite3 on the board. If it gets to a "sqlite>" prompt
without segfaulting, it worked.

To generate a working build:

    * replace -O2 with -O0 in the ./configure step. (-O1 fails too.)

Notes:

    * This package (sqlite3) is notable for a huge, single source file
-- sqlite3.c is 4.5mb.
    * With sqlite3.so.0.8.6 compiled -O0 and sqlite3 compiled -O2, the
build works (i.e. the problem occurs when the .so is optimized)
    * the CPU flags really aren't relevant; I've changed them recently
but the bug has been around for longer.
    * libsqlite3.so.0.8.6 isn't the last "relocation processing" that
occurs when the build works, suggesting it's a gcc/ld/ld.so bug.

Does anyone have suggestions for (a) how to get this bug report to the
right person, and (b) how to provide more useful information than this?

thanks,
Graeme Smecher
_______________________________________________
microblaze-linux mailing list
microblaze-linux <at> lists.itee.uq.edu.au
https://lists.eait.uq.edu.au/mailman/listinfo/microblaze-linux



--
John Williams, PhD, B. Eng, B. IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663
_______________________________________________
microblaze-linux mailing list
microblaze-linux@...
https://lists.eait.uq.edu.au/mailman/listinfo/microblaze-linux

Gmane