Yeah, I thought we can avoid this. Nevertheless it works fine with this:
./configure --triplet=arm-linux-gnueabihf --prefix=/usr --crtprefix=/usr/lib
So yes, I need to fix some paths around to match the system's.


On 12/23/18 4:53 PM, Christian Jullien wrote:

Ok what bout

./configure –triplet=arm-linux-gnueabihf

If it works, you can try to detect arch linux ./configure and find a way to force triplet in this case.

Maybe test with "/usr/lib/$tt/crti.o" or  “/usr/lib/crti.o” in this test

if test -n "$tt" -a -f "/usr/lib/$tt/crti.o" ; then

triplet="$tt"

fi

*From:*Tinycc-devel [mailto:[email protected]] *On Behalf Of *Barath Aron
*Sent:* dimanche 23 décembre 2018 16:39
*To:* [email protected]
*Subject:* Re: [Tinycc-devel] When is planned to be released the next versionof Tcc?

It is here it should be :)
/usr/lib/crti.o


$ gcc -Wl,-t hello1.c
/usr/bin/ld: mode armelf_linux_eabi
/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/8.2.0/../../../Scrt1.o
/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/8.2.0/../../../crti.o
/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/8.2.0/crtbeginS.o
/tmp/ccCWoDf6.o
libgcc_s.so.1 (/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/8.2.0/../../../libgcc_s.so.1)
/usr/lib/libc.so.6
(/usr/lib/libc_nonshared.a)elf-init.oS
/usr/lib/ld-linux-armhf.so.3
/usr/lib/ld-linux-armhf.so.3
libgcc_s.so.1 (/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/8.2.0/../../../libgcc_s.so.1)
/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/8.2.0/crtendS.o
/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/8.2.0/../../../crtn.o

On 12/23/18 4:35 PM, Christian Jullien wrote:

    On RPi, crti.o is located on /usr/lib/arm-linux-gnueabihf/crti.o.

    Where is it located on your board?

    You should adapt the different tcc scripts and Makefile so that it
    finds what it needs to work on your board.

    *From:*Tinycc-devel
    [mailto:[email protected]] *On
    Behalf Of *Barath Aron
    *Sent:* dimanche 23 décembre 2018 16:14
    *To:* [email protected] <mailto:[email protected]>
    *Subject:* Re: [Tinycc-devel] When is planned to be released the
    next versionof Tcc?

    I compile tcc natively. I have an Orange Pi Zero running Arch
    Linux ARM. I don't have to cross compile.

    I don't think they move to github. Btw, I prefer svn over whole
    git thing.


    On 12/23/18 4:09 PM, Pursuer wrote:

        I found out that I need to specify the CROSS_TARGET in
        config.mak manually to cross-compile tcc.

        And the Makefile may miss something.

        arm-eabihf_FILES=$(arm_FILES)

        should be inserted into line 169 (I think. )

        Now we can cross-compile to target arm-eabihf .

        If CROSS_TARGET is empty, Makefile will use NATIVE_TARGET as
        target instead. Maybe you should check this value.

        the NATIVE_TARGET is determined by CONFIG_XXX and ARCH

        By the way. How about maintaining this project on github?

        ------------------ Original ------------------

        *From: * "Barath Aron"<[email protected]>
        <mailto:[email protected]>;

        *Date: * Sun, Dec 23, 2018 10:23 PM

        *To: * "tinycc-devel"<[email protected]>
        <mailto:[email protected]>;

        *Subject: * Re: [Tinycc-devel] When is planned to be released
        the next versionof Tcc?

        Oh, I missed that, sorry.

        conftest returns "arm-linux-gnueabihf" as expected, but the
        test in the
        next line (configure:323):
           if test -n "$tt" -a -f "/usr/lib/$tt/crti.o" ; then
        is not true, because I do not have a directory such
        /usr/lib/arm-linux-gnueabihf

        [OFF]
        It is funny though, conftest converts __ARM_EABI__ and
        __ARM_PCS_VFP
        into a misty "gnueabihf", and then configure tries to decode
        this stuff
        into TCC_CONFIG_ARM and TCC_ARM_EABI based on a mysterious
        assumption
        ("/usr/lib/$tt/crti.o"). Sidenote: this triplet thing is the most
        shittiest thing in autotools (I know, tcc does not use
        autotools).
        That's why I prefer scconfig
        (http://repo.hu/projects/scconfig/) for my
        projects.
        [ON]

        Aron


        On 12/23/18 3:07 PM, Christian Jullien wrote:
        > As said, it's a temporary tool deleted by ./configure right
        after it's use.
        >
        > rm -f $TMPN* $CONFTEST
        >
        > Can you trace configure script to see how it uses $CONFTEST
        in different places and why configure.mak is not correct?
        >
        > C.
        >
        > -----Original Message-----
        > From: Tinycc-devel
        [mailto:[email protected]] On
        Behalf Of Barath Aron
        > Sent: dimanche 23 décembre 2018 15:02
        > To: [email protected] <mailto:[email protected]>
        > Subject: Re: [Tinycc-devel] When is planned to be released
        the next version of Tcc?
        >
        > I just ran:
        > $ gcc conftest.c -o conftest && ./conftest triplet
        > arm-linux-gnueabihf
        >
        > Although, it is strange, I do not have this executable after
        running
        > configure. Maybe configure decided to not use it?
        >
        >
        > On 12/23/18 2:43 PM, Christian Jullien wrote:
        >> Triplet is given by the temporary conftest tool. You can
        make it with:
        >>
        >> $ gcc conftest.c -o conftest && ./conftest triplet
        >> arm-linux-gnueabihf
        >>
        >> Try to debug this very small C program to see why triplet
        is not  defined on your system.
        >>
        >> -----Original Message-----
        >> From: Tinycc-devel
        [mailto:[email protected]] On
        Behalf Of Barath Aron
        >> Sent: dimanche 23 décembre 2018 14:32
        >> To: [email protected] <mailto:[email protected]>
        >> Subject: Re: [Tinycc-devel] When is planned to be released
        the next version of Tcc?
        >>
        >> What is in your triplet? Mine is empty.
        >>
        >> On 12/23/18 2:22 PM, Christian Jullien wrote:
        >>> On Raspbian, running ./configure I get:
        >>>
        >>> jullien@sims3:~/tinycc $ more config.mak
        >>> # Automatically generated by configure - do not modify
        >>> prefix=/usr/local
        >>> bindir=$(DESTDIR)/usr/local/bin
        >>> tccdir=$(DESTDIR)/usr/local/lib/tcc
        >>> libdir=$(DESTDIR)/usr/local/lib
        >>> includedir=$(DESTDIR)/usr/local/include
        >>> mandir=$(DESTDIR)/usr/local/share/man
        >>> infodir=$(DESTDIR)/usr/local/share/info
        >>> docdir=$(DESTDIR)/usr/local/share/doc
        >>> CC=gcc
        >>> GCC_MAJOR=6
        >>> GCC_MINOR=3
        >>> AR=ar
        >>> STRIP=strip -s -R .comment -R .note
        >>> CFLAGS=-Wall -g -O2 -Wdeclaration-after-statement
        -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
        -Wno-unused-result
        >>> LDFLAGS=
        >>> LIBSUF=.a
        >>> EXESUF=
        >>> DLLSUF=.so
        >>> NATIVE_DEFINES+=-DCONFIG_TRIPLET="\"arm-linux-gnueabihf\""
        >>> NATIVE_DEFINES+=-DTCC_CPU_VERSION=7
        >>> ARCH=arm
        >>> TARGETOS=Linux
        >>> CONFIG_arm_eabihf=yes
        >>> CONFIG_arm_vfp=yes
        >>> CONFIG_arm_vfp=yes
        >>> VERSION = 0.9.27
        >>> TOPSRC=$(TOP)
        >>>
        >>> This generated file is used by Makefile
        >>> Line 11: include $(TOP)/config.mak
        >>>
        >>> Then
        >>> Line 77: NATIVE_DEFINES_$(CONFIG_arm_eabihf) +=
        -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT
        >>>
        >>> IMHO, ./configure does something odd around line 336 with
        >>>
        >>>          if test "$cpu" = "arm" ; then
        >>>            if test "${triplet%eabihf}" != "$triplet" ; then
        >>>               confvars="$confvars arm_eabihf arm_vfp"
        >>>            elif test "${triplet%eabi}" != "$triplet" ; then
        >>>               confvars="$confvars arm_eabi"
        >>>            fi
        >>>            if grep -s -q "^Features.* \(vfp\|iwmmxt\) "
        /proc/cpuinfo ; then
        >>>               confvars="$confvars arm_vfp"
        >>>            fi
        >>>          fi
        >>>
        >>>
        >>> On my RPi it executes:
        >>>
        >>>            if test "${triplet%eabihf}" != "$triplet" ; then
        >>>               confvars="$confvars arm_eabihf arm_vfp"
        >>>
        >>> Which, then results to -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT
        in Makefile.
        >>>
        >>> C.
        >>>
        >>> -----Original Message-----
        >>> From: Tinycc-devel
        [mailto:[email protected]] On
        Behalf Of Barath Aron
        >>> Sent: dimanche 23 décembre 2018 13:55
        >>> To: [email protected] <mailto:[email protected]>
        >>> Subject: Re: [Tinycc-devel] When is planned to be released
        the next version of Tcc?
        >>>
        >>> I figured out. ARM_EXIDX was skipped because TCC_ARM_EABI
        was not
        >>> defined. What I did was just run ./configure without any
        arguments and
        >>> then a "make". Maybe this provides a clue to the maintainers.
        >>>
        >>> After hacking the defines (-DTCC_ARM_EABI
        -DTCC_ARM_HARDFLOAT), tcc now
        >>> does not crash during linking, because it now cannot
        compile. Weird.
        >>>
        >>> Aron
        >>>
        >>>
        >>> On 12/23/18 1:18 PM, Barath Aron wrote:
        >>>> In tccelf.c:2359, it clearly jumps to the end of the loop.
        >>>> And dies in the next loop: /* second short pass to
        update... */
        >>>>
        >>>> Take this gdb fragment as an explanation:
        >>>>
        >>>> Breakpoint 3, tcc_load_object_file (s1=0x45a098,
        s1@entry=0x454150,
        >>>>        fd=4562744, fd@entry=3, file_offset=4563600,
        file_offset@entry=0)
        >>>>        at tccelf.c:2357
        >>>> 2357            sh_name = (char *) strsec + sh->sh_name;
        >>>> (gdb) p i
        >>>> $21 = 6
        >>>> (gdb) n
        >>>> 2359            if (sh->sh_type != SHT_PROGBITS &&
        >>>> (gdb) p *sh
        >>>> $22 = {sh_name = 79, sh_type = 1879048193, sh_flags =
        130, sh_addr = 0,
        >>>>      sh_offset = 176, sh_size = 8, sh_link = 2, sh_info =
        0, sh_addralign
        >>>> = 4,
        >>>>      sh_entsize = 0}
        >>>> (gdb) n
        >>>> 2439        next: ;
        >>>> (gdb) n
        >>>> 2354            if (i == ehdr.e_shstrndx)
        >>>> (gdb) p i
        >>>> $23 = 7
        >>>>
        >>>> 1879048193 == 0x70000001 == SHT_ARM_EXIDX
        >>>>
        >>>> Aron
        >>>>
        >>>>
        >>>> On 12/23/18 11:52 AM, Daniel Glöckner wrote:
        >>>>> On Sun, Dec 23, 2018 at 11:44:50AM +0100, Barath Aron wrote:
        >>>>>> I traced the whole object loading procedure with gdb:
        >>>>>> - ARM_EXIDX (section 6) is definitely not loaded, I
        traced it with gdb.
        >>>>> Where did tcc decide to skip ARM_EXIDX?
        >>>>>
        >>>>> _______________________________________________
        >>>>> Tinycc-devel mailing list
        >>>>> [email protected] <mailto:[email protected]>
        >>>>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
        >>>> _______________________________________________
        >>>> Tinycc-devel mailing list
        >>>> [email protected] <mailto:[email protected]>
        >>>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
        >>> _______________________________________________
        >>> Tinycc-devel mailing list
        >>> [email protected] <mailto:[email protected]>
        >>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
        >>>
        >>>
        >>> _______________________________________________
        >>> Tinycc-devel mailing list
        >>> [email protected] <mailto:[email protected]>
        >>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
        >> _______________________________________________
        >> Tinycc-devel mailing list
        >> [email protected] <mailto:[email protected]>
        >> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
        >>
        >>
        >> _______________________________________________
        >> Tinycc-devel mailing list
        >> [email protected] <mailto:[email protected]>
        >> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
        >
        > _______________________________________________
        > Tinycc-devel mailing list
        > [email protected] <mailto:[email protected]>
        > https://lists.nongnu.org/mailman/listinfo/tinycc-devel
        >
        >
        > _______________________________________________
        > Tinycc-devel mailing list
        > [email protected] <mailto:[email protected]>
        > https://lists.nongnu.org/mailman/listinfo/tinycc-devel


        _______________________________________________
        Tinycc-devel mailing list
        [email protected] <mailto:[email protected]>
        https://lists.nongnu.org/mailman/listinfo/tinycc-devel




        _______________________________________________

        Tinycc-devel mailing list

        [email protected]  <mailto:[email protected]>

        https://lists.nongnu.org/mailman/listinfo/tinycc-devel



    _______________________________________________

    Tinycc-devel mailing list

    [email protected]  <mailto:[email protected]>

    https://lists.nongnu.org/mailman/listinfo/tinycc-devel


_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to