簡體   English   中英

如何在x86_64 Fedora上構建32位可執行文件?

[英]How do I build 32-bit executables on x86_64 Fedora?

我試圖在64位Fedora 21上運行32位可執行文件。

#include <stdio.h>

int main(){
    printf ("Hello C\n");

    return 1;
}


cc -m32 hello.c   -o helloi686

可執行文件返回錯誤的系統調用,或者不返回動態可執行文件。

已安裝的包裹

 glibc                                      i686                       2.20-8.fc21                                  @updates                                                   15 M
 glibc-devel                                i686                       2.20-8.fc21                                  @updates                                                  1.0 M
 libX11                                     i686                       1.6.2-2.fc21                                 @fedora                                                   1.3 M
 libXau                                     i686                       1.0.8-4.fc21                                 @fedora                                                    49 k
 libXext                                    i686                       1.3.3-2.fc21                                 @fedora                                                    87 k
 libXrandr                                  i686                       1.4.2-2.fc21                                 @fedora                                                    46 k
 libXrender                                 i686                       0.9.8-4.fc21                                 @fedora                                                    45 k
 libgcc                                     i686                       4.9.2-6.fc21                                 @updates                                                  202 k
 libstdc++                                  i686                       4.9.2-6.fc21                                 @updates                                                  1.0 M
 libxcb                                     i686                       1.11-3.fc21                                  @updates                                                  875 k
 ncurses-libs                               i686                       5.9-16.20140323.fc21                         @fedora                                                   932 k
 nss-softokn-freebl                         i686                       3.18.0-1.fc21                                @updates                                                  432 k
 zlib                                       i686                       1.2.8-7.fc21                                 @fedora                                                   187 k

在命令行中:

[root@machine platform-tools]# ldconfig -v | grep ld-linux
        ld-linux.so.2 -> ld-2.20.so
        ld-linux-x86-64.so.2 -> ld-2.20.so

[root@machine platform-tools]# ls -l /lib/ld-2.20.so
-rwxr-xr-x 1 root root 159020 feb 27 13:02 /lib/ld-2.20.so

什么包應該解決這個問題?

可以是systemd配置文件system.conf已經啟用了SystemCallArchitectures和其他arch。

調整/刪除它。 dracut -f,並重新啟動。

暫無
暫無

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

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