Current state of multilib support (powerpc)

Alexey Neyman stilor@att.net
Thu May 19 04:55:00 GMT 2016


[Sorry for previous emails; fat fingers hit send accidentally]

Hi,

On 05/18/2016 02:11 PM, Bryan Hundven wrote:
> (Added Alexey Neyman, who did the multilib work)
>> On May 18, 2016, at 5:33 AM, Thomas De Schampheleire <patrickdepinguin@gmail.com> wrote:
>>
>> Hi Bryan,
>>
>> On Tue, May 17, 2016 at 3:50 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
>>>> On May 17, 2016, at 6:19 AM, Thomas De Schampheleire <patrickdepinguin@gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> In 2014 there has been some work on multilib support in crosstool-ng,
>>>> by Bryan Hundven, Cody P. Schafer, and Ray Donnelly. See e.g. mail
>>>> threads [1] and [2].
>>>>
>>>> It looks as if this work has not been integrated in crosstool-ng.
>>>> Meanwhile also the bitbucket branch referenced in the threads no
>>>> longer exists and I can't find the corresponding branches on github.
>>>>
>>>> What is the latest state of this work?
>>>> Where are the latest patches?
>>>> What are the remaining problems?
>>>>
>>>> I'm currently interested in a multilib toolchain 32/64 bit for
>>>> Freescale e6500 processors.
>>>> I ported one of Cody's patches to crosstool-ng 1.22.0 and the build
>>>> advanced a bit further than with the 1.22.0 baseline, but now breaks
>>>> at the 'pass-2 core C gcc compiler' step.
>>>>
>>>> Thanks,
>>>> Thomas
>>>>
>>>> [1] https://sourceware.org/ml/crossgcc/2014-01/msg00054.html
>>>> [2] https://sourceware.org/ml/crossgcc/2014-07/msg00014.html
>>> See here: https://github.com/crosstool-ng/crosstool-ng/pull/383
>>>
>>> Please test and review.
> Alexey, could you help out with this one?
>
>> Interesting, thanks!
>>
>> I created a toolchain based on that PR with the following configuration:
>>
>> CT_PREFIX_DIR="${CT_TOP_DIR}/targets/${CT_TARGET}"
>> CT_ARCH_CPU="e6500"
>> CT_ARCH_64=y
>> CT_ARCH_powerpc=y
>> CT_MULTILIB=y
>> CT_KERNEL_linux=y
>> CT_KERNEL_V_3_18=y
>> CT_BINUTILS_EXTRA_CONFIG_ARRAY="--enable-targets=powerpc-linux,powerpc64-linux"
>> CT_CC_GCC_V_4_9_3=y
>> CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="--enable-targets=powerpc-linux,powerpc64-linux"
>> CT_CC_GCC_EXTRA_CONFIG_ARRAY="--enable-targets=powerpc-linux,powerpc64-linux"
>> CT_CC_GCC_MULTILIB_LIST="powerpc-linux,powerpc64-linux"
>> CT_CC_LANG_CXX=y
>>
>> The idea is that 32-bit should be the default, without requiring
>> additional options on the compiler command-line.
>>
>> When passing this toolchain to buildroot, applications seems to build
>> fine in 32-bit (I did not try to run them yet).
>> The kernel is also correctly built in 64-bit.
>> However, there is something wrong for u-boot. I get errors like:
The fact that both 32- and 64-bit applications compile fine indicate 
that gcc indeed is passing the options to ld correctly. I tried building 
a simple app in 32- and 64-bit modes, with -v, and the output shows that 
in 64-bit mode, -m64 is added to the arguments - as expected.
>>
>> /foo/output/host/usr/bin/powerpc64-unknown-linux-gnu-ld.bfd:
>> Relocatable linking with relocations from format elf32-powerpc
>> (arch/powerpc/cpu/mpc8xxx/cpu.o) to format elf64-powerpc
>> (arch/powerpc/cpu/mpc8xxx/built-in.o) is not supported
Which target are you building? I tried some random powerpc target 
(xpedite517x_defconfig) and the build failed due to some invalid 
assembly but went past mpc8xxx/built-in.o:

   CC      arch/powerpc/cpu/mpc8xxx/cpu.o
   CC      arch/powerpc/cpu/mpc8xxx/fdt.o
   CC      arch/powerpc/cpu/mpc8xxx/fsl_lbc.o
   CC      arch/powerpc/cpu/mpc8xxx/law.o
   LD      arch/powerpc/cpu/mpc8xxx/built-in.o
   LD      arch/powerpc/cpu/built-in.o
   AS      arch/powerpc/cpu/mpc86xx/cache.o
   CC      arch/powerpc/cpu/mpc86xx/cpu.o
   CC      arch/powerpc/cpu/mpc86xx/cpu_init.o
   CC      arch/powerpc/cpu/mpc86xx/fdt.o
   CC      arch/powerpc/cpu/mpc86xx/interrupts.o
   CC      arch/powerpc/cpu/mpc86xx/mpc8641_serdes.o
   CC      arch/powerpc/cpu/mpc86xx/speed.o
   LD      arch/powerpc/cpu/mpc86xx/built-in.o
   AS      arch/powerpc/cpu/mpc86xx/start.o
arch/powerpc/cpu/mpc86xx/start.S: Assembler messages:
arch/powerpc/cpu/mpc86xx/start.S:466: Error: missing operand

Hard to say what went wrong without the name of the target that failed 
for you. It looks, however, like U-Boot's build system expects 
binutils/gcc to default to exact CPU for the target - not surprising 
given the variety of PowerPC assembly dialects...

Regards,
Alexey.
>>
>> which indicates that the default format used by ld.bfd is 64-bit
>> rather than 32-bit. If I manually replay this command-line with the
>> additional -m elf32ppc, it seems to work correctly and a 32-bit
>> builtin.o is created.
>>
>> What am I missing? Why is ld not taking 32-bit as default, while gcc is?
>>
>> (I did not post to the github PR because it may all be caused by a
>> misconfiguration or misunderstanding on my part).
>>
>> Thanks,
>> Thomas


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



More information about the crossgcc mailing list