The following message is displayed and fails to compile.
CC = clang
CFLAGS = -O2 -pipe -mtune=generic -ansi -pedantic -W -Wall -Wcast-align -Wcast-qual -Wcomments -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-admin/chrpath-0.13-r2/work/chrpath-0.13 ...
gmake: Entering directory `/var/tmp/portage/app-admin/chrpath-0.13-r2/work/chrpath-0.13'
Making all in testsuite
gmake: Entering directory `/var/tmp/portage/app-admin/chrpath-0.13-r2/work/chrpath-0.13/testsuite'
clang -R /usr/local/lib -o prog prog.c
clang: warning: argument unused during compilation: '-R'
/usr/local/lib: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [prog] Error 1
gmake: Leaving directory `/var/tmp/portage/app-admin/chrpath-0.13-r2/work/chrpath-0.13/testsuite'
gmake: *** [all-recursive] Error 1
gmake: Leaving directory `/var/tmp/portage/app-admin/chrpath-0.13-r2/work/chrpath-0.13'
gmake: *** [all] Error 2
* ERROR: app-admin/chrpath-0.13-r2 failed (compile phase):
* emake failed
Steps to Reproduce:
1. CC=clang emerge app-admin/chrpath
Created attachment 355160 [details, diff]
Created attachment 355162 [details, diff]
sample patch for chrpath-0.13-r2.ebuild
I have exactly the same problem on macos. And I also basically add "-Wl,-rpath" in the darwin section. However in my case chrpath should be completely masked because chrpath relies elf.h which is not there since the format is mach-o for me.
Obsoleting bugs for ancient clang versions.