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

  1. added a commit that references this issue on Jun 25, 2018
  2. added a commit that references this issue on Jul 1, 2019
  3. added a commit that references this issue on Aug 26, 2019
  4. added a commit that references this issue on Nov 6, 2019
  5. added a commit that references this issue on Dec 15, 2019
  6. added a commit that references this issue on Jul 23, 2020
  7. added a commit that references this issue on Sep 29, 2020
  8. added a commit that references this issue on May 12, 2021
  9. added a commit that references this issue on Oct 4, 2021
    8cc9f68
  10. added a commit that references this issue on Feb 1, 2022
  11. 113 remaining items

  12. added a commit that references this issue on Jul 14, 2026
  13. added a commit that references this issue on Sep 17, 2026
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