This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can not build flat shared library.


On 3/14/2011 6:14 PM, Yann E. MORIN wrote:
Gary, All,

On Monday 14 March 2011 22:52:21 Gary Altenberg wrote:
I am attempting to build a tool chain for an ARM (no mmu arm7tdmi) to
build applications for a uClinux board. I read that I should use a
shared library so I set my "Target File Format" in uClibc to Shared
FLAT. It says in the help for Shared FLAT to "Pick this one if you are
using uClinux and wish to build uClibc as a flat-format shared library".
Are there options in gcc to pick this also? I didn't see any.
I believe we do not currently have proper support for flat binaries.
You should have a look at:
   scripts/build/kernel/linux.sh
in function CT_DoKernelTupleValues:

   CT_DoKernelTupleValues() {
       if [ "${CT_ARCH_USE_MMU}" = "y" ]; then
           CT_TARGET_KERNEL="linux"
       else
       # Sometime, noMMU linux targets have a -uclinux tuple, while
       # sometime it's -linux. We currently have only one noMMU linux
       # target, and it uses -linux, so let's just use that. Time
       # to fix that later...
       #    CT_TARGET_KERNEL="uclinux"
           CT_TARGET_KERNEL="linux"
       fi
   }

So in your case, I guess you'd want a tuple that ends with -uclinux instead
of -linux. Care to test that (override in the script)? If it works, then it
will be time to review that function and be a bit more inventive there.

Also, in the binutils sub-menu, you will have to choose one of:
- 'Flat' and a version of elf2flt,
- 'FD_PIC ELF'

Note: AFAICR, the "only one noMMU linux target" referred-to in the linux
kernel script, above, is blackfin.

Regards,
Yann E. MORIN.

Yann,

I un-commented the CT_TARGET_KERNEL="uclinux" and attempted to build. I did not use FD_PIC ELF but just flat and elf2flt.

In the log file I now get:

gtyp-input.list:15: file /work/arm-tools/targets/src/gcc-4.3.1/gcc/config/arm/uclinux-elf.h specified more than once for language (all)

By the way when I build using the original configuration I sent you the tools build just fine and I can build and run uClinux on my ARM hardware. I was having problems with the applications but I am able to get some working. I even got the miniupnpc library to work in my application. I just can't seem to get busybox and most of the applications that are in uClinux distribution to work. I keep getting:

Unhandled fault: vector exception (0x800) at 0x00000000
SIGSEGV

In the case of miniupnpc it was using a -fPIC option that I removed and I also put in -march=armv4t and -mtune=arm7tdmi and now it runs. I tried that with busybox with no luck yet.

So what benefit will there be in having CT_TARGET_KERNEL set to uclinux?

Regards,
Gary

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]