How to find out triplet without gcc?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I try to find out the triplet for my device, because i try to cross compile, but there is no gcc installed on the target device and i am not allowed to install it.



With gcc installed i could just write gcc -dumpmachine



Is it possible to find this information without gcc?










share|improve this question



















  • 1




    how far will uname -a get you here?
    – Fiximan
    Aug 25 '15 at 11:59











  • i get Linux MyDeviceName 2.6.35.3-571-gcca29a0-g8b63513-dirty #162 PREEMPT Tue Aug 4 10:57:29 CEST 2015 armv5tejl GNU/Linux
    – Black
    Aug 25 '15 at 12:09







  • 1




    Can you tell us the manufacturer and model of the target device, for example Freescale MX28EVK ?
    – Mark Plotnick
    Aug 25 '15 at 12:15










  • No i can't, its a small special device with a metal housing and nothing written on it.
    – Black
    Aug 25 '15 at 12:21






  • 1




    So you have a armv5tejl core, GNU/Linux as OS, and if you really need the vendor, too, try lshw -class cpu and ignore the "should be run as super-user" part.
    – Fiximan
    Aug 25 '15 at 12:23














up vote
3
down vote

favorite












I try to find out the triplet for my device, because i try to cross compile, but there is no gcc installed on the target device and i am not allowed to install it.



With gcc installed i could just write gcc -dumpmachine



Is it possible to find this information without gcc?










share|improve this question



















  • 1




    how far will uname -a get you here?
    – Fiximan
    Aug 25 '15 at 11:59











  • i get Linux MyDeviceName 2.6.35.3-571-gcca29a0-g8b63513-dirty #162 PREEMPT Tue Aug 4 10:57:29 CEST 2015 armv5tejl GNU/Linux
    – Black
    Aug 25 '15 at 12:09







  • 1




    Can you tell us the manufacturer and model of the target device, for example Freescale MX28EVK ?
    – Mark Plotnick
    Aug 25 '15 at 12:15










  • No i can't, its a small special device with a metal housing and nothing written on it.
    – Black
    Aug 25 '15 at 12:21






  • 1




    So you have a armv5tejl core, GNU/Linux as OS, and if you really need the vendor, too, try lshw -class cpu and ignore the "should be run as super-user" part.
    – Fiximan
    Aug 25 '15 at 12:23












up vote
3
down vote

favorite









up vote
3
down vote

favorite











I try to find out the triplet for my device, because i try to cross compile, but there is no gcc installed on the target device and i am not allowed to install it.



With gcc installed i could just write gcc -dumpmachine



Is it possible to find this information without gcc?










share|improve this question















I try to find out the triplet for my device, because i try to cross compile, but there is no gcc installed on the target device and i am not allowed to install it.



With gcc installed i could just write gcc -dumpmachine



Is it possible to find this information without gcc?







cross-compilation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:36









Community♦

1




1










asked Aug 25 '15 at 11:50









Black

4932728




4932728







  • 1




    how far will uname -a get you here?
    – Fiximan
    Aug 25 '15 at 11:59











  • i get Linux MyDeviceName 2.6.35.3-571-gcca29a0-g8b63513-dirty #162 PREEMPT Tue Aug 4 10:57:29 CEST 2015 armv5tejl GNU/Linux
    – Black
    Aug 25 '15 at 12:09







  • 1




    Can you tell us the manufacturer and model of the target device, for example Freescale MX28EVK ?
    – Mark Plotnick
    Aug 25 '15 at 12:15










  • No i can't, its a small special device with a metal housing and nothing written on it.
    – Black
    Aug 25 '15 at 12:21






  • 1




    So you have a armv5tejl core, GNU/Linux as OS, and if you really need the vendor, too, try lshw -class cpu and ignore the "should be run as super-user" part.
    – Fiximan
    Aug 25 '15 at 12:23












  • 1




    how far will uname -a get you here?
    – Fiximan
    Aug 25 '15 at 11:59











  • i get Linux MyDeviceName 2.6.35.3-571-gcca29a0-g8b63513-dirty #162 PREEMPT Tue Aug 4 10:57:29 CEST 2015 armv5tejl GNU/Linux
    – Black
    Aug 25 '15 at 12:09







  • 1




    Can you tell us the manufacturer and model of the target device, for example Freescale MX28EVK ?
    – Mark Plotnick
    Aug 25 '15 at 12:15










  • No i can't, its a small special device with a metal housing and nothing written on it.
    – Black
    Aug 25 '15 at 12:21






  • 1




    So you have a armv5tejl core, GNU/Linux as OS, and if you really need the vendor, too, try lshw -class cpu and ignore the "should be run as super-user" part.
    – Fiximan
    Aug 25 '15 at 12:23







1




1




how far will uname -a get you here?
– Fiximan
Aug 25 '15 at 11:59





how far will uname -a get you here?
– Fiximan
Aug 25 '15 at 11:59













i get Linux MyDeviceName 2.6.35.3-571-gcca29a0-g8b63513-dirty #162 PREEMPT Tue Aug 4 10:57:29 CEST 2015 armv5tejl GNU/Linux
– Black
Aug 25 '15 at 12:09





i get Linux MyDeviceName 2.6.35.3-571-gcca29a0-g8b63513-dirty #162 PREEMPT Tue Aug 4 10:57:29 CEST 2015 armv5tejl GNU/Linux
– Black
Aug 25 '15 at 12:09





1




1




Can you tell us the manufacturer and model of the target device, for example Freescale MX28EVK ?
– Mark Plotnick
Aug 25 '15 at 12:15




Can you tell us the manufacturer and model of the target device, for example Freescale MX28EVK ?
– Mark Plotnick
Aug 25 '15 at 12:15












No i can't, its a small special device with a metal housing and nothing written on it.
– Black
Aug 25 '15 at 12:21




No i can't, its a small special device with a metal housing and nothing written on it.
– Black
Aug 25 '15 at 12:21




1




1




So you have a armv5tejl core, GNU/Linux as OS, and if you really need the vendor, too, try lshw -class cpu and ignore the "should be run as super-user" part.
– Fiximan
Aug 25 '15 at 12:23




So you have a armv5tejl core, GNU/Linux as OS, and if you really need the vendor, too, try lshw -class cpu and ignore the "should be run as super-user" part.
– Fiximan
Aug 25 '15 at 12:23










3 Answers
3






active

oldest

votes

















up vote
3
down vote













You can get a lot of information by means of uname and also by checking with file the type of executables:



$ gcc -dumpmachine
x86_64-linux-gnu
$ uname -o -m
x86_64 GNU/Linux
$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d8ac02806880576708bf189c064fca78ea89f1d0, stripped


If your device doesn't have file installed, copy a binary executable from it to another Linux computer and run file there.






share|improve this answer






















  • Thank you for your answer. Where can i find a binary executable? Under /usr/bin ? Sorry, im pretty much beginner, so an example would be great.
    – Black
    Aug 26 '15 at 6:18







  • 1




    If you got the file command as shown in the snippet above you can use it itself as executable example. Otherwise any other file in /usr/bin should do.
    – planetmaker
    Aug 26 '15 at 6:54

















up vote
1
down vote













You'll need to find files in the file system which preserve the triplet passed to / probed by configure on the build time of your target userland.



In common GNU/Linux distributions the best bet would be querying to common command binaries like bash curl make svn. In the following example on Debian/armhf (QEMU image taken from here) I got the canonical triplet arm-unknown-linux-gnueabihf by bash --version. So it would be basically safe to configure my cross toolchain for this system by /path/to/configure --target=arm-unknown-linux-gnueabihf.



root@debian-armhf:~# bash --version
GNU bash, version 4.2.37(1)-release (arm-unknown-linux-gnueabihf)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


There's no reliable way to know non-canonical triplet like arm-linux-gnueabihf x86_64-linux-gnu from the userland, and there might be distribution specific conventions like Debian multiarch and tuples. You'll need to collect info from your distribution's document or other resources online.






share|improve this answer




















  • Thx for your answer, but unfortunattely the command "bash" is not available too.
    – Black
    Aug 26 '15 at 11:34










  • Which distribution are you using
    – Erkin Alp Güney
    Apr 23 '17 at 13:49

















up vote
0
down vote













Another option is make -v. In my laptop:



$ make -v 
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


Then built triple is x86_64-pc-linux-gnu.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f225350%2fhow-to-find-out-triplet-without-gcc%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    You can get a lot of information by means of uname and also by checking with file the type of executables:



    $ gcc -dumpmachine
    x86_64-linux-gnu
    $ uname -o -m
    x86_64 GNU/Linux
    $ file /usr/bin/file
    /usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d8ac02806880576708bf189c064fca78ea89f1d0, stripped


    If your device doesn't have file installed, copy a binary executable from it to another Linux computer and run file there.






    share|improve this answer






















    • Thank you for your answer. Where can i find a binary executable? Under /usr/bin ? Sorry, im pretty much beginner, so an example would be great.
      – Black
      Aug 26 '15 at 6:18







    • 1




      If you got the file command as shown in the snippet above you can use it itself as executable example. Otherwise any other file in /usr/bin should do.
      – planetmaker
      Aug 26 '15 at 6:54














    up vote
    3
    down vote













    You can get a lot of information by means of uname and also by checking with file the type of executables:



    $ gcc -dumpmachine
    x86_64-linux-gnu
    $ uname -o -m
    x86_64 GNU/Linux
    $ file /usr/bin/file
    /usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d8ac02806880576708bf189c064fca78ea89f1d0, stripped


    If your device doesn't have file installed, copy a binary executable from it to another Linux computer and run file there.






    share|improve this answer






















    • Thank you for your answer. Where can i find a binary executable? Under /usr/bin ? Sorry, im pretty much beginner, so an example would be great.
      – Black
      Aug 26 '15 at 6:18







    • 1




      If you got the file command as shown in the snippet above you can use it itself as executable example. Otherwise any other file in /usr/bin should do.
      – planetmaker
      Aug 26 '15 at 6:54












    up vote
    3
    down vote










    up vote
    3
    down vote









    You can get a lot of information by means of uname and also by checking with file the type of executables:



    $ gcc -dumpmachine
    x86_64-linux-gnu
    $ uname -o -m
    x86_64 GNU/Linux
    $ file /usr/bin/file
    /usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d8ac02806880576708bf189c064fca78ea89f1d0, stripped


    If your device doesn't have file installed, copy a binary executable from it to another Linux computer and run file there.






    share|improve this answer














    You can get a lot of information by means of uname and also by checking with file the type of executables:



    $ gcc -dumpmachine
    x86_64-linux-gnu
    $ uname -o -m
    x86_64 GNU/Linux
    $ file /usr/bin/file
    /usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d8ac02806880576708bf189c064fca78ea89f1d0, stripped


    If your device doesn't have file installed, copy a binary executable from it to another Linux computer and run file there.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Aug 25 '15 at 23:06









    Gilles

    511k12010141543




    511k12010141543










    answered Aug 25 '15 at 12:01









    planetmaker

    25918




    25918











    • Thank you for your answer. Where can i find a binary executable? Under /usr/bin ? Sorry, im pretty much beginner, so an example would be great.
      – Black
      Aug 26 '15 at 6:18







    • 1




      If you got the file command as shown in the snippet above you can use it itself as executable example. Otherwise any other file in /usr/bin should do.
      – planetmaker
      Aug 26 '15 at 6:54
















    • Thank you for your answer. Where can i find a binary executable? Under /usr/bin ? Sorry, im pretty much beginner, so an example would be great.
      – Black
      Aug 26 '15 at 6:18







    • 1




      If you got the file command as shown in the snippet above you can use it itself as executable example. Otherwise any other file in /usr/bin should do.
      – planetmaker
      Aug 26 '15 at 6:54















    Thank you for your answer. Where can i find a binary executable? Under /usr/bin ? Sorry, im pretty much beginner, so an example would be great.
    – Black
    Aug 26 '15 at 6:18





    Thank you for your answer. Where can i find a binary executable? Under /usr/bin ? Sorry, im pretty much beginner, so an example would be great.
    – Black
    Aug 26 '15 at 6:18





    1




    1




    If you got the file command as shown in the snippet above you can use it itself as executable example. Otherwise any other file in /usr/bin should do.
    – planetmaker
    Aug 26 '15 at 6:54




    If you got the file command as shown in the snippet above you can use it itself as executable example. Otherwise any other file in /usr/bin should do.
    – planetmaker
    Aug 26 '15 at 6:54












    up vote
    1
    down vote













    You'll need to find files in the file system which preserve the triplet passed to / probed by configure on the build time of your target userland.



    In common GNU/Linux distributions the best bet would be querying to common command binaries like bash curl make svn. In the following example on Debian/armhf (QEMU image taken from here) I got the canonical triplet arm-unknown-linux-gnueabihf by bash --version. So it would be basically safe to configure my cross toolchain for this system by /path/to/configure --target=arm-unknown-linux-gnueabihf.



    root@debian-armhf:~# bash --version
    GNU bash, version 4.2.37(1)-release (arm-unknown-linux-gnueabihf)
    Copyright (C) 2011 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.


    There's no reliable way to know non-canonical triplet like arm-linux-gnueabihf x86_64-linux-gnu from the userland, and there might be distribution specific conventions like Debian multiarch and tuples. You'll need to collect info from your distribution's document or other resources online.






    share|improve this answer




















    • Thx for your answer, but unfortunattely the command "bash" is not available too.
      – Black
      Aug 26 '15 at 11:34










    • Which distribution are you using
      – Erkin Alp Güney
      Apr 23 '17 at 13:49














    up vote
    1
    down vote













    You'll need to find files in the file system which preserve the triplet passed to / probed by configure on the build time of your target userland.



    In common GNU/Linux distributions the best bet would be querying to common command binaries like bash curl make svn. In the following example on Debian/armhf (QEMU image taken from here) I got the canonical triplet arm-unknown-linux-gnueabihf by bash --version. So it would be basically safe to configure my cross toolchain for this system by /path/to/configure --target=arm-unknown-linux-gnueabihf.



    root@debian-armhf:~# bash --version
    GNU bash, version 4.2.37(1)-release (arm-unknown-linux-gnueabihf)
    Copyright (C) 2011 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.


    There's no reliable way to know non-canonical triplet like arm-linux-gnueabihf x86_64-linux-gnu from the userland, and there might be distribution specific conventions like Debian multiarch and tuples. You'll need to collect info from your distribution's document or other resources online.






    share|improve this answer




















    • Thx for your answer, but unfortunattely the command "bash" is not available too.
      – Black
      Aug 26 '15 at 11:34










    • Which distribution are you using
      – Erkin Alp Güney
      Apr 23 '17 at 13:49












    up vote
    1
    down vote










    up vote
    1
    down vote









    You'll need to find files in the file system which preserve the triplet passed to / probed by configure on the build time of your target userland.



    In common GNU/Linux distributions the best bet would be querying to common command binaries like bash curl make svn. In the following example on Debian/armhf (QEMU image taken from here) I got the canonical triplet arm-unknown-linux-gnueabihf by bash --version. So it would be basically safe to configure my cross toolchain for this system by /path/to/configure --target=arm-unknown-linux-gnueabihf.



    root@debian-armhf:~# bash --version
    GNU bash, version 4.2.37(1)-release (arm-unknown-linux-gnueabihf)
    Copyright (C) 2011 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.


    There's no reliable way to know non-canonical triplet like arm-linux-gnueabihf x86_64-linux-gnu from the userland, and there might be distribution specific conventions like Debian multiarch and tuples. You'll need to collect info from your distribution's document or other resources online.






    share|improve this answer












    You'll need to find files in the file system which preserve the triplet passed to / probed by configure on the build time of your target userland.



    In common GNU/Linux distributions the best bet would be querying to common command binaries like bash curl make svn. In the following example on Debian/armhf (QEMU image taken from here) I got the canonical triplet arm-unknown-linux-gnueabihf by bash --version. So it would be basically safe to configure my cross toolchain for this system by /path/to/configure --target=arm-unknown-linux-gnueabihf.



    root@debian-armhf:~# bash --version
    GNU bash, version 4.2.37(1)-release (arm-unknown-linux-gnueabihf)
    Copyright (C) 2011 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.


    There's no reliable way to know non-canonical triplet like arm-linux-gnueabihf x86_64-linux-gnu from the userland, and there might be distribution specific conventions like Debian multiarch and tuples. You'll need to collect info from your distribution's document or other resources online.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Aug 26 '15 at 10:44









    yaegashi

    7,89611432




    7,89611432











    • Thx for your answer, but unfortunattely the command "bash" is not available too.
      – Black
      Aug 26 '15 at 11:34










    • Which distribution are you using
      – Erkin Alp Güney
      Apr 23 '17 at 13:49
















    • Thx for your answer, but unfortunattely the command "bash" is not available too.
      – Black
      Aug 26 '15 at 11:34










    • Which distribution are you using
      – Erkin Alp Güney
      Apr 23 '17 at 13:49















    Thx for your answer, but unfortunattely the command "bash" is not available too.
    – Black
    Aug 26 '15 at 11:34




    Thx for your answer, but unfortunattely the command "bash" is not available too.
    – Black
    Aug 26 '15 at 11:34












    Which distribution are you using
    – Erkin Alp Güney
    Apr 23 '17 at 13:49




    Which distribution are you using
    – Erkin Alp Güney
    Apr 23 '17 at 13:49










    up vote
    0
    down vote













    Another option is make -v. In my laptop:



    $ make -v 
    GNU Make 4.1
    Built for x86_64-pc-linux-gnu
    Copyright (C) 1988-2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.


    Then built triple is x86_64-pc-linux-gnu.






    share|improve this answer
























      up vote
      0
      down vote













      Another option is make -v. In my laptop:



      $ make -v 
      GNU Make 4.1
      Built for x86_64-pc-linux-gnu
      Copyright (C) 1988-2014 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.


      Then built triple is x86_64-pc-linux-gnu.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Another option is make -v. In my laptop:



        $ make -v 
        GNU Make 4.1
        Built for x86_64-pc-linux-gnu
        Copyright (C) 1988-2014 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.


        Then built triple is x86_64-pc-linux-gnu.






        share|improve this answer












        Another option is make -v. In my laptop:



        $ make -v 
        GNU Make 4.1
        Built for x86_64-pc-linux-gnu
        Copyright (C) 1988-2014 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.


        Then built triple is x86_64-pc-linux-gnu.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 8 at 12:17









        Mark J. Adams

        252213




        252213



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f225350%2fhow-to-find-out-triplet-without-gcc%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay