• Linking error on mips64el...

    From =?UTF-8?Q?St=c3=a9phane_Glondu?=@21:1/5 to All on Thu Jan 16 11:40:01 2020
    Dear MIPS experts,

    ocaml 4.08.8-7 currently FTBFS on mips64el. The previous version,
    4.08.8-6 did build fine and the only difference is metadata.

    I investigated on porterbox eller.debian.org, and realized the following doesn't work in a mips64el sid chroot:

    $ cat add.c
    int add(int a, int b) {
    return a + b;
    }
    $ cat sub.c
    int sub(int a, int b) {
    return a - b;
    }
    $ gcc -c add.c
    $ gcc -c sub.c
    $ ld -r -o toto.o add.o sub.o
    ld: add.o: ABI is incompatible with that of the selected emulation
    ld: failed to merge target specific data of file add.o
    ld: sub.o: ABI is incompatible with that of the selected emulation
    ld: failed to merge target specific data of file sub.o
    ld: attempt to do relocatable link with elf64-tradlittlemips input and elf32-ntradlittlemips output
    ld: add.o: file class ELFCLASS64 incompatible with ELFCLASS32
    ld: final link failed: file in wrong format

    ...whereas it works on amd64.

    Does anyone have an idea on what is going on?


    Cheers,

    --
    Stéphane

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Thu Jan 16 11:50:01 2020
    Stéphane Glondu <glondu@debian.org> 于2020年1月16日周四 下午6:32写道:

    Dear MIPS experts,

    ocaml 4.08.8-7 currently FTBFS on mips64el. The previous version,
    4.08.8-6 did build fine and the only difference is metadata.

    I investigated on porterbox eller.debian.org, and realized the following doesn't work in a mips64el sid chroot:

    $ cat add.c
    int add(int a, int b) {
    return a + b;
    }
    $ cat sub.c
    int sub(int a, int b) {
    return a - b;
    }
    $ gcc -c add.c
    $ gcc -c sub.c
    $ ld -r -o toto.o add.o sub.o

    There must be a bug for binutils....
    We seems meet similar problem when build glib2.0.

    ld: add.o: ABI is incompatible with that of the selected emulation
    ld: failed to merge target specific data of file add.o
    ld: sub.o: ABI is incompatible with that of the selected emulation
    ld: failed to merge target specific data of file sub.o
    ld: attempt to do relocatable link with elf64-tradlittlemips input and elf32-ntradlittlemips output
    ld: add.o: file class ELFCLASS64 incompatible with ELFCLASS32
    ld: final link failed: file in wrong format

    ...whereas it works on amd64.

    Does anyone have an idea on what is going on?


    Cheers,

    --
    Stéphane



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From YunQiang Su@21:1/5 to All on Thu Jan 16 17:00:02 2020
    YunQiang Su <wzssyqa@gmail.com> 于2020年1月16日周四 下午6:44写道:

    Stéphane Glondu <glondu@debian.org> 于2020年1月16日周四 下午6:32写道:

    Dear MIPS experts,

    ocaml 4.08.8-7 currently FTBFS on mips64el. The previous version,
    4.08.8-6 did build fine and the only difference is metadata.

    I investigated on porterbox eller.debian.org, and realized the following doesn't work in a mips64el sid chroot:

    $ cat add.c
    int add(int a, int b) {
    return a + b;
    }
    $ cat sub.c
    int sub(int a, int b) {
    return a - b;
    }
    $ gcc -c add.c
    $ gcc -c sub.c
    $ ld -r -o toto.o add.o sub.o

    There must be a bug for binutils....
    We seems meet similar problem when build glib2.0.

    ld: add.o: ABI is incompatible with that of the selected emulation
    ld: failed to merge target specific data of file add.o
    ld: sub.o: ABI is incompatible with that of the selected emulation
    ld: failed to merge target specific data of file sub.o
    ld: attempt to do relocatable link with elf64-tradlittlemips input and elf32-ntradlittlemips output
    ld: add.o: file class ELFCLASS64 incompatible with ELFCLASS32
    ld: final link failed: file in wrong format

    ...whereas it works on amd64.

    Does anyone have an idea on what is going on?

    The problem is that one of our patch need to refresh:
    https://salsa.debian.org/toolchain-team/binutils/merge_requests/4



    Cheers,

    --
    Stéphane



    --
    YunQiang Su



    --
    YunQiang Su

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)