gcc 理解从源代码编译LLVM时的乱码错误

zzwlnbp8  于 2023-05-07  发布在  其他
关注(0)|答案(2)|浏览(84)

以下是我做的事
1.编译并安装gcc-9.2。
1.编译并安装GNU binutils-2.32
1.编译并安装GNU Make-4.2
1.我从LLVM站点下载了LLVM、Clang、LLD、libcxx、libcxxabi、lldb、polly、openmp和compiler-rt的源代码(版本8.0.1)。
1.我继续编译LLVM沿着上述项目。
在编译过程中,我得到一些乱码错误。我复制了下面的部分输出:

In file included from /data/stars/user/uujjwal/collection-stars/gcc-9.2/include/c++/9.2.0/iomanip:43,
                 from /tmp/llvm/llvm/utils/PerfectShuffle/PerfectShuffle.cpp:19:
/usr/bin/locale:112:4: error: stray ‘\10’ in program
/usr/bin/locale:112:12: error: stray ‘\30’ in program
/usr/bin/locale:112:20: error: stray ‘\302’ in program
/usr/bin/locale:112:24: error: stray ‘\1’ in program
/usr/bin/locale:112:28: error: stray ‘\6’ in program
/usr/bin/locale:112:37: error: stray ‘\27’ in program
/usr/bin/locale:112:38: error: stray ‘@’ in program
/usr/bin/locale:112:45: error: stray ‘\27’ in program
/usr/bin/locale:112:52: error: stray ‘\32’ in program
/usr/bin/locale:112:68: error: stray ‘\4’ in program
/usr/bin/locale:112:84: error: stray ‘\315’ in program
/usr/bin/locale:112:88: error: stray ‘\1’ in program
/usr/bin/locale:112:92: error: stray ‘\6’ in program
/usr/bin/locale:112:100: error: stray ‘\220’ in program
/usr/bin/locale:112:101: error: stray ‘\27’ in program
/usr/bin/locale:112:102: error: stray ‘@’ in program
/usr/bin/locale:112:108: error: stray ‘\220’ in program
/usr/bin/locale:112:109: error: stray ‘\27’ in program
/usr/bin/locale:112:117: error: stray ‘\4’ in program
/usr/bin/locale:112:132: error: stray ‘\20’ in program
/usr/bin/locale:112:140: error: stray ‘\20’ in program
/usr/bin/locale:112:148: error: stray ‘\340’ in program
/usr/bin/locale:112:152: error: stray ‘\1’ in program
/usr/bin/locale:112:156: error: stray ‘\6’ in program
/usr/bin/locale:112:165: error: stray ‘\34’ in program
/usr/bin/locale:112:166: error: stray ‘@’ in program
/usr/bin/locale:112:173: error: stray ‘\34’ in program
/usr/bin/locale:112:180: error: stray ‘\362’ in program
/usr/bin/locale:112:196: error: stray ‘\20’ in program
/usr/bin/locale:112:216: error: stray ‘\1’ in program
/usr/bin/locale:112:220: error: stray ‘\6’ in program
/usr/bin/locale:112:228: error: stray ‘\364’ in program
/usr/bin/locale:112:230: error: stray ‘@’ in program
/usr/bin/locale:112:236: error: stray ‘\364’ in program
/usr/bin/locale:112:260: error: stray ‘\4’ in program
/usr/bin/locale:112:276: error: stray ‘\7’ in program
/usr/bin/locale:112:280: error: stray ‘\1’ in program
/usr/bin/locale:112:284: error: stray ‘\2’ in program
/usr/bin/locale:112:294: error: stray ‘@’ in program
/usr/bin/locale:112:308: error: stray ‘\331’ in program
/usr/bin/locale:112:309: error: stray ‘\25’ in program
/usr/bin/locale:112:340: error: stray ‘\247’ in program
/usr/bin/locale:112:344: error: stray ‘\1’ in program
/usr/bin/locale:112:348: error: stray ‘\2’ in program
/usr/bin/locale:112:356: error: stray ‘\334’ in program
/usr/bin/locale:112:358: error: stray ‘@’ in program
/usr/bin/locale:112:364: error: stray ‘\334’ in program
/usr/bin/locale:112:373: error: stray ‘\1’ in program
/usr/bin/locale:112:388: error: stray ‘\4’ in program
/usr/bin/locale:112:408: error: stray ‘\1’ in program
/usr/bin/locale:112:412: error: stray ‘\2’ in program
/usr/bin/locale:112:420: error: stray ‘\20’ in program
/usr/bin/locale:112:422: error: stray ‘@’ in program
/usr/bin/locale:112:428: error: stray ‘\20’ in program
/usr/bin/locale:112:436: error: stray ‘\354’ in program
/usr/bin/locale:112:437: error: stray ‘\6’ in program
/usr/bin/locale:112:452: error: stray ‘\10’ in program
/usr/bin/locale:112:468: error: stray ‘\362’ in program
/usr/bin/locale:112:472: error: stray ‘\16’ in program
/usr/bin/locale:112:476: error: stray ‘\3’ in program
/usr/bin/locale:112:486: error: stray ‘`’ in program
/usr/bin/locale:112:500: error: stray ‘\10’ in program
/usr/bin/locale:112:516: error: stray ‘\10’ in program
/usr/bin/locale:112:532: error: stray ‘\346’ in program
/usr/bin/locale:112:536: error: stray ‘\17’ in program
/usr/bin/locale:112:540: error: stray ‘\3’ in program
/usr/bin/locale:112:548: error: stray ‘\10’ in program
/usr/bin/locale:112:550: error: stray ‘`’ in program
/usr/bin/locale:112:556: error: stray ‘\10’ in program
/usr/bin/locale:112:564: error: stray ‘\10’ in program
/usr/bin/locale:112:580: error: stray ‘\10’ in program
/usr/bin/locale:112:596: error: stray ‘\242’ in program
/usr/bin/locale:112:600: error: stray ‘\1’ in program
/usr/bin/locale:112:604: error: stray ‘\3’ in program
/usr/bin/locale:112:612: error: stray ‘\20’ in program
/usr/bin/locale:112:614: error: stray ‘`’ in program
/usr/bin/locale:112:620: error: stray ‘\20’ in program
/usr/bin/locale:112:628: error: stray ‘\10’ in program
/usr/bin/locale:112:644: error: stray ‘\10’ in program
/usr/bin/locale:112:660: error: stray ‘\31’ in program
/usr/bin/locale:112:664: error: stray ‘\6’ in program
/usr/bin/locale:112:668: error: stray ‘\3’ in program
/usr/bin/locale:112:676: error: stray ‘\30’ in program
/usr/bin/locale:112:678: error: stray ‘`’ in program
/usr/bin/locale:112:684: error: stray ‘\30’ in program
/usr/bin/locale:112:692: error: stray ‘\340’ in program
/usr/bin/locale:112:693: error: stray ‘\1’ in program
/usr/bin/locale:112:700: error: stray ‘\7’ in program
/usr/bin/locale:112:708: error: stray ‘\10’ in program
/usr/bin/locale:112:716: error: stray ‘\20’ in program
/usr/bin/locale:112:724: error: stray ‘\333’ in program
/usr/bin/locale:112:728: error: stray ‘\1’ in program
/usr/bin/locale:112:732: error: stray ‘\3’ in program
/usr/bin/locale:112:740: error: stray ‘\370’ in program
/usr/bin/locale:112:742: error: stray ‘`’ in program
/usr/bin/locale:112:748: error: stray ‘\370’ in program
/usr/bin/locale:112:756: error: stray ‘\10’ in program
/usr/bin/locale:112:772: error: stray ‘\10’ in program
/usr/bin/locale:112:780: error: stray ‘\10’ in program
/usr/bin/locale:112:788: error: stray ‘\322’ in program
/usr/bin/locale:112:792: error: stray ‘\1’ in program
/usr/bin/locale:112:796: error: stray ‘\3’ in program
/usr/bin/locale:112:806: error: stray ‘`’ in program
/usr/bin/locale:112:821: error: stray ‘\2’ in program
/usr/bin/locale:112:836: error: stray ‘\10’ in program
/usr/bin/locale:112:844: error: stray ‘\10’ in program
/usr/bin/locale:112:852: error: stray ‘\1’ in program
/usr/bin/locale:112:856: error: stray ‘\1’ in program
/usr/bin/locale:112:860: error: stray ‘\3’ in program
/usr/bin/locale:112:868: error: stray ‘`’ in program
/usr/bin/locale:112:870: error: stray ‘`’ in program
/usr/bin/locale:112:876: error: stray ‘`’ in program
/usr/bin/locale:112:885: error: stray ‘\34’ in program
/usr/bin/locale:112:916: error: stray ‘\275’ in program
/usr/bin/locale:112:920: error: stray ‘\10’ in program
/usr/bin/locale:112:924: error: stray ‘\3’ in program
/usr/bin/locale:112:932: error: stray ‘\320’ in program
/usr/bin/locale:112:933: error: stray ‘\216’ in program
/usr/bin/locale:112:934: error: stray ‘`’ in program
/usr/bin/locale:112:940: error: stray ‘\304’ in program
/usr/bin/locale:112:941: error: stray ‘\216’ in program
/usr/bin/locale:112:964: error: stray ‘\20’ in program
/usr/bin/locale:112:984: error: stray ‘\1’ in program
/usr/bin/locale:112:1004: error: stray ‘\304’ in program
/usr/bin/locale:112:1005: error: stray ‘\216’ in program
/usr/bin/locale:112:1012: error: stray ‘\24’ in program
/usr/bin/locale:112:1028: error: stray ‘\4’ in program
/usr/bin/locale:112:1044: error: stray ‘\17’ in program
/usr/bin/locale:112:1048: error: stray ‘\3’ in program
/usr/bin/locale:112:1068: error: stray ‘\330’ in program
/usr/bin/locale:112:1069: error: stray ‘\216’ in program
/usr/bin/locale:112:1076: error: stray ‘\376’ in program
/usr/bin/locale:112:1092: error: stray ‘\1’ in program

    In file included from /data/stars/user/uujjwal/collection-stars/gcc-9.2/include/c++/9.2.0/iomanip:43,
                     from /tmp/llvm/llvm/utils/PerfectShuffle/PerfectShuffle.cpp:19:
    /usr/bin/locale:4:109: error: ‘t’ does not name a type; did you mean ‘tm’?
        4 |            pp`
                                             xp`
                                                                   �p`                    �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`                   �p`        D            q`                  q`                   q`                   q`                    q`                    (q`        !           0q`        "           8q`        #           @q`        $           Hq`        %           Pq`        &           Xq`        '           `q`        (           hq`        )           pq`        *           xq`        +           �q`        ,           �q`        -           �q`        J           �q`        .           �q`        /           �q`        G           �q`        0           �q`        1           �q`        2           �q`        3           �q`        4           �q`        5           �q`        6           �q`        7           �q`        8           �q`        9            r`        :          r`        ;           r`        <           r`        =            r`        >           (r`        ?           0r`        @           8r`        A           @r`        B           H�H��X  H��t��  H��              �5rX  �%tX  @ �%rX  h    ������%jX  h   ������%bX  h   ������%ZX  h   ������%RX  h   ������%JX  h   ������%BX  h   ������%:X  h   �p����%2X     �`����%*X  h    �P����%"X  h
          |                                                                                                             ^
          |                                                                                                             tm
    In file included from /data/stars/user/uujjwal/collection-stars/gcc-9.2/include/c++/9.2.0/iomanip:43,
                     from /tmp/llvm/llvm/utils/PerfectShuffle/PerfectShuffle.cpp:19:
    /usr/bin/locale:5:721: error: ‘libc’ does not name a type
        5 |    �@����%X  h
                              �0����%X  h
                                             � ����%
          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ^
    In file included from /data/stars/user/uujjwal/collection-stars/gcc-9.2/include/c++/9.2.0/iomanip:43,
                     from /tmp/llvm/llvm/utils/PerfectShuffle/PerfectShuffle.cpp:19:
    /usr/bin/locale:12:234: error: expected unqualified-id before numeric constant
       12 |    []A\A]�����D  D�j  E����  1��{~C�     �;��w���H��tH�5�i  H�������H�5�i  �;   �������C��9�ŋ;��<���H��tH�5`i  H�������D� �i  E���X���H�5Ai  �"   �7����B���f��?������ si  H�Ņ��(  H�������E �������L@ ��<E�1�����������D  �?�����H��H���E  H�������A�ċi  ����   A���*  A�D$�A�����H�\f��E ��L@ <��AD�1�H���s���H9�u���������<E�H���L@ 1�[]A\A]�H����     �?����H�ŋ�h  ��u�����     H�[]A\A]�D  H���L@ 1�� �������@ H���L@ 1�������7��� H���L@ 1����������� H�1���L@ ��������� H�1���L@ ���������� H���L@ 1����������� E1������E��D  u
          |                                                                                                                                                                                                                                          ^
    In file included from /data/stars/user/uujjwal/collection-stars/gcc-9.2/include/c++/9.2.0/iomanip:43,
                     from /tmp/llvm/llvm/utils/PerfectShuffle/PerfectShuffle.cpp:19:
    /usr/bin/locale:16:279: error: expected declaration before ‘}’ token
       16 | ��   I�WH����u  fD  H��H�����   �DV t�� �SH��H�0�f�     H���H���DF u���tr�CH�K��u�-@ H�����tH���DV t�<
          |                                                                                                                                                                                                                                                                                       ^
    /usr/bin/locale:16:282: error: ‘H’ does not name a type
       16 | ��   I�WH����u  fD  H��H�����   �DV t�� �SH��H�0�f�     H���H���DF u���tr�CH�K��u�-@ H�����tH���DV t�<
          |                                                                                                                                                                                                                                                                                          ^
    /usr/bin/locale:16:316: error: expected declaration before ‘}’ token
       16 | ��   I�WH����u  fD  H��H�����   �DV t�� �SH��H�0�f�     H���H���DF u���tr�CH�K��u�-@ H�����tH���DV t�<
          |                                                                                                                                                                                                                                                                                                                            ^
    /usr/bin/locale:16:319: error: ‘u4’ does not name a type
       16 | ��   I�WH����u  fD  H��H�����   �DV t�� �SH��H�0�f�     H���H���DF u���tr�CH�K��u�-@ H�����tH���DV t�<
          |                                                                                                                                                                                                                                                                                                                               ^
    /usr/bin/locale:16:355: error: ‘H’ does not name a type
       16 | ��   I�WH����u  fD  H��H�����   �DV t�� �SH��H�0�f�     H���H���DF u���tr�CH�K��u�-@ H�����tH���DV t�<
          |                                                                                                                                                                                                                                                                                                                                                                   ^
    /usr/bin/locale:16:398: error: ‘M’ does not name a type
       16 | ��   I�WH����u  fD  H��H�����   �DV t�� �SH��H�0�f�     H���H���DF u���tr�CH�K��u�-@ H�����tH���DV t�<
          |                                                                                                                                                                                                                                                                                                                                                                                                              ^
    /usr/bin/locale:16:412: error: ‘u’ does not name a type
       16 | ��   I�WH����u  fD  H��H�����   �DV t�� �SH��H�0�f�     H���H���DF u���tr�CH�K��u�-@ H�����tH���DV t�<
          |                                                                                                                                                                                                                                                                                                                                                                                                                            ^
    /usr/bin/locale:19:70: error: expected declaration before ‘}’ token
       19 |    H�������H��t�A�$�����L������L������� ƅ����
          |                                                                      ^
    /usr/bin/locale:19:74: error: expected unqualified-id before numeric constant
       19 |    H�������H��t�A�$�����L������L������� ƅ����
          |                                                                          ^
    make[2]: *** [utils/PerfectShuffle/CMakeFiles/llvm-PerfectShuffle.dir/build.make:63: utils/PerfectShuffle/CMakeFiles/llvm-PerfectShuffle.dir/PerfectShuffle.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:20749: utils/PerfectShuffle/CMakeFiles/llvm-PerfectShuffle.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....

locale的输出如下:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

我不明白为什么会出现这样的错误。我已经很努力地寻找了,但绝对找不到任何东西。据我所知,这类问题是由于代码中的乱码造成的。考虑到它是LLVM的稳定版本,我希望情况不是这样。我该怎么解决这个问题?

ut6juiuv

ut6juiuv1#

我也犯了同样的错误。结果是我的~/.zshrc中的一个导出错误导致了这个问题

export CPATH=<some_stuff>:$PATH // <---- TYPO
tktrz96b

tktrz96b2#

确保包含正确的locale文件,该文件是位于/usr/inlcude/c++/7中的C源代码,在您的情况下,可能会错误地包含locale可执行文件。

相关问题