Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc 9.3.0 -fno-plt -fuse-ld=gold results into bad instructions on ppc64le #48

Open
nehaljwani opened this issue Jan 24, 2021 · 5 comments

Comments

@nehaljwani
Copy link
Member

Steps to reproduce (on a powerpc box):

# conda create -yp ./dev gxx_linux-ppc64le -c conda-forge
# conda activate ./dev
# cat <<EOF > wth.cpp
#include <iostream>
int main() {
   return 0;
}
EOF
# $CXX wth.cpp -g -fno-plt -fuse-ld=gold
./a.out
Illegal instruction

Another pruned example (from mongodb build system):

#include <cstring>
#include <cstdint>
#include <cstdlib>

int main() {
    using Native = __vector signed char;
    const size_t size = sizeof(Native);
    const Native bits = { 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0 };

    uint8_t inputBuf[size];
    std::memset(inputBuf, 0xFF, sizeof(inputBuf));

    return 0;
}

This is also reproducible using the cross compilers + qemu-static + binfmt_misc + QEMU_LD_PREFIX. The error is simply:

qemu: uncaught target signal 4 (Illegal instruction) - core dumped
[1]    641165 illegal hardware instruction (core dumped)  ./a.out

Not sure if this has been reported upstream, as I am able to reproduce this only with this combo: -fno-plt + -fuse-ld=gold. If I remove either, the problem goes away.

I saw this problem happen with mongodb and mysql. @hmaarrfk found that downgrading the compiler version to 8 resolves the issue, so I ended up doing that on both these feedstocks.

cc @isuruf @beckermr

@nehaljwani
Copy link
Member Author

I'm planning to report it upstream, waiting on BZ account creation at the moment.

@mingwandroid have you ever come across this problem before?

@nehaljwani nehaljwani changed the title There is something obscurely wrong with gcc 9.3.0 for ppc64le gcc 9.3.0 -fno-plt -fuse-ld=gold results into bad instructions on ppc64le Jan 24, 2021
@mingwandroid
Copy link

mingwandroid commented Jan 24, 2021

I haven't come across it, no. I am working on compilers at the moment though. I am looking at 10.2 as the base-line for GCC.

@xhochy
Copy link
Member

xhochy commented Jan 28, 2022

@nehaljwani did you ever get to report this upstream?

@nehaljwani
Copy link
Member Author

At the time when I hit the problem, I couldn't reproduce it with a compiler built from source (not using the recipe), so couldn't report it upstream.

@hmaarrfk
Copy link
Contributor

I hit this conda-forge/fish-feedstock#29 here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants