Skip to content

Clang 5.0.1 doesn't work out of the box. #110

Description

@kalaxy

Hi,
I'm using Joyent pkgin on a CentOS7 machine. When I try to compile I get an error for missing libs.

$ echo 'int main() { return 0; }' | /usr/pkg/bin/clang++ -xc++  - -o /dev/null 
/..//bin/ld: cannot find crtbegin.o: No such file or directory
/..//bin/ld: cannot find -lstdc++
/..//bin/ld: cannot find -lgcc_s
/..//bin/ld: cannot find -lgcc
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)

At first I thought this was the same issue as TritonDataCenter/pkgsrc-legacy#288, but it doesn't appear to be as complicated. To solve the issue I can install any gcc, e.g., sudo pkgin -y install gcc7. Then use the --gcc-toolchain parameter to point clang to the required files.

$ echo 'int main() { return 0; }' | /usr/pkg/bin/clang++ -xc++ --gcc-toolchain=/usr/pkg/gcc7 - -o /dev/null
$ echo $?
0

Is this expected user behavior to manually pick a gcc and reference it from the command line?

Thanks,
Kalon

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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