Obtaining current GCC architecture

前端 未结 5 2018
长情又很酷
长情又很酷 2020-12-14 05:57

How can I find out what the -march default argument is for the current architecture if I don\'t supply any?

5条回答
  •  被撕碎了的回忆
    2020-12-14 06:38

    Running the command

    gcc -v
    

    will show something like this:

    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/lto-wrapper
    Target: x86_64-unknown-linux-gnu
    Configured with: /build/src/gcc-4.7.1/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --disable-ppl-version-check --disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu --enable-multilib --disable-libssp --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-checking=release
    Thread model: posix
    gcc versie 4.7.1 (GCC) 
    

    The Target: line is what you want. You should be able to deduce enough information from this.

提交回复
热议问题