簡體   English   中英

從源代碼編譯GCC到.s匯編文件

[英]Compiling GCC from source down to .s assembly file

我正在執行二進制代碼重寫。 我這樣做的原因是在不訪問其源代碼的情況下增強了二進制代碼的健壯性。 所以我打算做的是在匯編級別重寫,因為在反匯編上重寫要困難得多。

我想要的是我要增強的程序的.s匯編文件。 海灣合作委員會就是其中之一。 我試圖破解GCC Makefile ,並將-save-temps添加到其中的每個CFLAGSCXXFLAGS 我在編譯coreutils上做了同樣的事情,並且成功獲取了諸如lscat等之類的coreutils中任何程序的.s文件。但是,在GCC Makefile做同樣的事情,我得到了錯誤。 這是我使用的配置命令:

../gcc-svn/configure --prefix=/opt/mygcc

這是我得到的部分錯誤(大多數是有意義的重新定義錯誤):

In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:73:10: error: redefinition of ‘struct std::__true_type’
   struct __true_type { };
          ^~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:73:10: note: previous definition of ‘struct std::__true_type’
   struct __true_type { };
          ^~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:74:10: error: redefinition of ‘struct std::__false_type’
   struct __false_type { };
          ^~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:74:10: note: previous definition of ‘struct std::__false_type’
   struct __false_type { };
          ^~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:77:12: error: redefinition of ‘struct std::__truth_type<<anonymous> >’
     struct __truth_type
            ^~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:77:12: note: previous definition of ‘struct std::__truth_type<<anonymous> >’
     struct __truth_type
            ^~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:81:12: error: redefinition of ‘struct std::__truth_type<true>’
     struct __truth_type<true>
            ^~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:81:12: note: previous definition of ‘struct std::__truth_type<true>’
     struct __truth_type<true>
            ^~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:87:12: error: redefinition of ‘struct std::__traitor<_Sp, _Tp>’
     struct __traitor
            ^~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:87:12: note: previous definition of ‘struct std::__traitor<_Sp, _Tp>’
     struct __traitor
            ^~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:95:12: error: redefinition of ‘struct std::__are_same< <template-parameter-1-1>, <template-parameter-1-2> >’
     struct __are_same
            ^~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:95:12: note: previous definition of ‘struct std::__are_same< <template-parameter-1-1>, <template-parameter-1-2> >’
     struct __are_same
            ^~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:102:12: error: redefinition of ‘struct std::__are_same<_Tp, _Tp>’
     struct __are_same<_Tp, _Tp>
            ^~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:102:12: note: previous definition of ‘struct std::__are_same<_Tp, _Tp>’
     struct __are_same<_Tp, _Tp>
            ^~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:110:12: error: redefinition of ‘struct std::__is_void<_Tp>’
     struct __is_void
            ^~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:110:12: note: previous definition of ‘struct std::__is_void<_Tp>’
     struct __is_void
            ^~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:117:12: error: redefinition of ‘struct std::__is_void<void>’
     struct __is_void<void>
            ^~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:117:12: note: previous definition of ‘struct std::__is_void<void>’
     struct __is_void<void>
            ^~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:127:12: error: redefinition of ‘struct std::__is_integer<_Tp>’
     struct __is_integer
            ^~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:127:12: note: previous definition of ‘struct std::__is_integer<_Tp>’
     struct __is_integer
            ^~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:138:12: error: redefinition of ‘struct std::__is_integer<bool>’
     struct __is_integer<bool>
            ^~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:138:12: note: previous definition of ‘struct std::__is_integer<bool>’
     struct __is_integer<bool>
            ^~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:145:12: error: redefinition of ‘struct std::__is_integer<char>’
     struct __is_integer<char>
            ^~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:145:12: note: previous definition of ‘struct std::__is_integer<char>’
     struct __is_integer<char>
            ^~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:152:12: error: redefinition of ‘struct std::__is_integer<signed char>’
     struct __is_integer<signed char>
            ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:152:12: note: previous definition of ‘struct std::__is_integer<signed char>’
     struct __is_integer<signed char>
            ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:159:12: error: redefinition of ‘struct std::__is_integer<unsigned char>’
     struct __is_integer<unsigned char>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:159:12: note: previous definition of ‘struct std::__is_integer<unsigned char>’
     struct __is_integer<unsigned char>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:167:12: error: redefinition of ‘struct std::__is_integer<wchar_t>’
     struct __is_integer<wchar_t>
            ^~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:167:12: note: previous definition of ‘struct std::__is_integer<wchar_t>’
     struct __is_integer<wchar_t>
            ^~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:176:12: error: redefinition of ‘struct std::__is_integer<char16_t>’
     struct __is_integer<char16_t>
            ^~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:176:12: note: previous definition of ‘struct std::__is_integer<char16_t>’
     struct __is_integer<char16_t>
            ^~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:183:12: error: redefinition of ‘struct std::__is_integer<char32_t>’
     struct __is_integer<char32_t>
            ^~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:183:12: note: previous definition of ‘struct std::__is_integer<char32_t>’
     struct __is_integer<char32_t>
            ^~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:191:12: error: redefinition of ‘struct std::__is_integer<short int>’
     struct __is_integer<short>
            ^~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:191:12: note: previous definition of ‘struct std::__is_integer<short int>’
     struct __is_integer<short>
            ^~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:198:12: error: redefinition of ‘struct std::__is_integer<short unsigned int>’
     struct __is_integer<unsigned short>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:198:12: note: previous definition of ‘struct std::__is_integer<short unsigned int>’
     struct __is_integer<unsigned short>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:205:12: error: redefinition of ‘struct std::__is_integer<int>’
     struct __is_integer<int>
            ^~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:205:12: note: previous definition of ‘struct std::__is_integer<int>’
     struct __is_integer<int>
            ^~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:212:12: error: redefinition of ‘struct std::__is_integer<unsigned int>’
     struct __is_integer<unsigned int>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:212:12: note: previous definition of ‘struct std::__is_integer<unsigned int>’
     struct __is_integer<unsigned int>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:219:12: error: redefinition of ‘struct std::__is_integer<long int>’
     struct __is_integer<long>
            ^~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:219:12: note: previous definition of ‘struct std::__is_integer<long int>’
     struct __is_integer<long>
            ^~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:226:12: error: redefinition of ‘struct std::__is_integer<long unsigned int>’
     struct __is_integer<unsigned long>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:226:12: note: previous definition of ‘struct std::__is_integer<long unsigned int>’
     struct __is_integer<unsigned long>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:233:12: error: redefinition of ‘struct std::__is_integer<long long int>’
     struct __is_integer<long long>
            ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:233:12: note: previous definition of ‘struct std::__is_integer<long long int>’
     struct __is_integer<long long>
            ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:240:12: error: redefinition of ‘struct std::__is_integer<long long unsigned int>’
     struct __is_integer<unsigned long long>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:240:12: note: previous definition of ‘struct std::__is_integer<long long unsigned int>’
     struct __is_integer<unsigned long long>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:261:19: error: redefinition of ‘struct std::__is_integer<__int128>’
 __INT_N(__GLIBCXX_TYPE_INT_N_0)
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:261:19: note: previous definition of ‘struct std::__is_integer<__int128>’
 __INT_N(__GLIBCXX_TYPE_INT_N_0)
                   ^~~~~~~~~~~~~         
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:261:76: error: redefinition of ‘struct std::__is_integer<__int128 unsigned>’
 __INT_N(__GLIBCXX_TYPE_INT_N_0)
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:261:115: note: previous definition of ‘struct std::__is_integer<__int128 unsigned>’
 __INT_N(__GLIBCXX_TYPE_INT_N_0)
                                                                                                                   ^                              
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:61,
                 from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/array:34,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdtr1c++.h:31:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:279:12: error: redefinition of ‘struct std::__is_floating<_Tp>’
     struct __is_floating
            ^~~~~~~~~~~~~
In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:42,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:41:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/cpp_type_traits.h:279:12: note: previous definition of ‘struct std::__is_floating<_Tp>’
     struct __is_floating
            ^~~~~~~~~~~~~

<AND THERE ARE MORE ERRORS IN BETWEEN BUT IT TAKES LOTS OF SPACE.>

In file included from ~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/algorithm:60,
                 from ~/gcc/gcc-svn/libstdc++-v3/include/precompiled/stdc++.h:65:
~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include/utility:321:12: note: previous definition of ‘struct std::integer_sequence<_Tp, _Idx>’
     struct integer_sequence
            ^~~~~~~~~~~~~~~~
Makefile:1752: recipe for target 'x86_64-pc-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch' failed
make[5]: *** [x86_64-pc-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch] Error 1
make[5]: Leaving directory '~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3/include'
Makefile:511: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3'
Makefile:418: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '~/gcc/objdir-makehack/x86_64-pc-linux-gnu/libstdc++-v3'
Makefile:15895: recipe for target 'all-stage1-target-libstdc++-v3' failed
make[2]: *** [all-stage1-target-libstdc++-v3] Error 2
make[2]: Leaving directory '~/gcc/objdir-makehack'
Makefile:24352: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '~/gcc/objdir-makehack'
Makefile:944: recipe for target 'all' failed
make: *** [all] Error 2

知道如何獲取GCC .s文件,或者擺脫這些錯誤的系統方法是什么?

由於某些原因,我需要gcc的.S程序集文件

您無法獲得單個.S文件(大寫S )。 BTW, .S文件通常是手寫的可預處理匯編代碼(旨在首先由預處理程序處理)。 它們由cpp預處理程序轉換為一些普通的.s匯編文件,結果由as處理。

您可以為GCC編譯器的每個翻譯單元獲得一個.s文件(小寫的.scc1cc1plus匯編代碼輸出,並輸入到as )( 成千上萬個這樣的文件 ,與您獲得的.o文件一樣多)。 )。 而且您將需要大量的磁盤空間。

我的建議是:

首先,將您的GCC配置為僅能正確編譯。 也許

 ../gcc-svn/configure --with-multilib-list=m32,m64 \
    --with-endian=big,little --prefix=/opt/mygcc  --program-suffix=-my

可能會在您的系統上運行(我很驚訝:為什么您要--with-multilib-list=m32,m64 --with-endian=big,little ?我不會使用它)。 你應該試試。 然后運行make -j

當(幾個小時后),其沒有完全工作,消除你的構建樹中的所有文件,然后重新嘗試,通過附加CFLAGS=-save-temps (見 )到以前的(和成功的) configure命令。 另見有關定義變量configure

但是,如果您確實要更改從GCC編譯的二進制文件,則更改編譯器本身可能更簡單,也許可以通過編寫GCC編譯器插件來進行 當然,這仍然需要數月的工作(困難的部分是要了解GCC及其內部表示形式)。

只需要將“ -save-temps”開關添加到Makefile中的一個CFLAGS中即可。 標記的名稱是BOOT_CFLAGS ,其注釋為“將傳遞給stage2並隨后制造的標記”。 在我的情況下,我使用了gcc 7.3和帶有--prefix的簡單configure命令,該標志位於Makefile的351行中。 通過該更改,我可以在構建目錄的“ ./gcc”子目錄中獲取gcc的“ .s”文件。

順便感謝您的幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM