Skip to content

binaryen is being built with inappropriate compiler flags for i586-unknown-linux-gnu host #49267

Closed
@kepstin

Description

@kepstin

I've been trying to get an i586-unknown-linux-gnu build of rustc 1.24.1 going for a while, and I've gotten close, but the final rustc binary is crashing with an illegal instruction:

Program received signal SIGILL, Illegal instruction.
0xb6dbca15 in cashew::IStringSet::IStringSet(char const*) ()
   from /home/cwalton/rust-1.24.1-i586-unknown-linux-gnu-stage0/bin/../lib/../lib/librustc_trans-1401e33888f16318.so
(gdb) bt
#0  0xb6dbca15 in cashew::IStringSet::IStringSet(char const*) ()
   from /home/cwalton/rust-1.24.1-i586-unknown-linux-gnu-stage0/bin/../lib/../lib/librustc_trans-1401e33888f16318.so
#1  0xb6bf93cc in _GLOBAL__sub_I_parser.cpp ()
   from /home/cwalton/rust-1.24.1-i586-unknown-linux-gnu-stage0/bin/../lib/../lib/librustc_trans-1401e33888f16318.so
#2  0xb7fe827e in call_init.part () from /lib/ld-linux.so.2
#3  0xb7fe8375 in _dl_init () from /lib/ld-linux.so.2
#4  0xb7fd9aff in _dl_start_user () from /lib/ld-linux.so.2

When looking into it, this particular piece of code is from the native binaryen library. From the build log build/i586-unknown-linux-gnu/stage0-rustc/i586-unknown-linux-gnu/release/build/rustc_binaryen-b307d012dc0782fb/output:

running: "cmake" "/home/cwalton/rustc-1.24.1-src/src/librustc_binaryen/../binaryen" "-DBUILD_STATIC_LIB=ON" "-DCMAKE_INSTALL_PREFIX=/home/cwalton/rustc-1.24.1-src/build/i586-unknown-linux-gnu/stage0-rustc/i586-unknown-linux-gnu/release/build/rustc_binaryen-b307d012dc0782fb/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -ffunction-sections -fdata-sections -fPIC -m32 -march=pentium -m32 -march=pentium" "-DCMAKE_C_COMPILER=/usr/i586-pc-linux-gnu/gcc-bin/7.3.0/i586-pc-linux-gnu-gcc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -ffunction-sections -fdata-sections -fPIC -m32 -march=pentium -m32 -march=pentium" "-DCMAKE_CXX_COMPILER=/usr/i586-pc-linux-gnu/gcc-bin/7.3.0/i586-pc-linux-gnu-c++" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/i586-pc-linux-gnu/gcc-bin/7.3.0/i586-pc-linux-gnu-gcc
-- Check for working C compiler: /usr/i586-pc-linux-gnu/gcc-bin/7.3.0/i586-pc-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/i586-pc-linux-gnu/gcc-bin/7.3.0/i586-pc-linux-gnu-c++
-- Check for working CXX compiler: /usr/i586-pc-linux-gnu/gcc-bin/7.3.0/i586-pc-linux-gnu-c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Building with -std=c++11
-- Building for platform i386
-- Building with -msse2
-- Building with -mfpmath=sse
-- Building with -Wall
-- Building with -Werror
-- Building with -Wextra
-- Building with -Wno-unused-parameter
-- Building with -fno-omit-frame-pointer
-- Building with -fPIC
-- Building with -O2
-- Building with -UNDEBUG
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cwalton/rustc-1.24.1-src/build/i586-unknown-linux-gnu/stage0-rustc/i586-unknown-linux-gnu/release/build/rustc_binaryen-b307d012dc0782fb/out/build

It's building with the compiler options -msse2 -mfpmath=sse which should not be used on the i586 target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions