On Mon, 2025-09-15 at 07:16 -0400, Greg Troxel wrote:
> Johannes Berg <
joha...@sipsolutions.net> writes:
> 
> > On Fri, 2025-09-12 at 20:39 -0400, Greg Troxel wrote:
> > > I can make a proper commit, but
> > > 
> > >   - pkgsrc adds -L for the pkgsrc compiler wrappers lib directory, for
> > >     visibility control
> > >   - bup passes -Werror in try_c_code() in configure
> > >   - clang warns if there is a -L which is unused.  That's a bug, because
> > >     -L means "if you are looking for a library, look here too" and it's
> > >     not wrong to include -L on link lines that don't have a -l.
> > 
> > I'd argue it's not a clang bug (although I do sometimes wish clang was
> > less strict about this kind of issue), because
> 
> It said "unused", vs "-L was passed to a -c call", but I see your point.
Right, since there's no link stage it's (necessarily!) unused.
> > > +++ config/configure
> > > @@ -29,7 +29,7 @@ bup_try_c_code()
> > >      esac
> > >      tmpdir="$(mktemp -d "bup-try-c-compile-XXXXXXX")" || exit $?
> > >      echo "$code" > "$tmpdir/test.c" || exit $?
> > > -    $AC_CC -Wall -Werror $cflags -c -o "$tmpdir/test" "$tmpdir/test.c"
> > > +    $AC_CC -Wall $cflags -c -o "$tmpdir/test" "$tmpdir/test.c"
> > 
> > That command line really is, due to the "-c", a pure compilation
> > (technically "preprocess, compile, and assemble steps") command without
> > any linking.
> 
> Hmm, I guess it is, but it's bizarre to have -o to test (vs test.o).
Huh, I didn't even notice that, but yeah.
> Perhaps -L from pkgsrc was triggered by that.
No idea. I've been fighting nixos clang wrappers, so I'm a bit allergic
to wrappers right now ;-)
johannes