c-ares icon indicating copy to clipboard operation
c-ares copied to clipboard

Avoid warnings from ranlib on macOS

Open timwoj opened this issue 3 years ago • 4 comments

This fixes these warnings emitted when building a static library on macOS as reported in https://github.com/c-ares/c-ares/issues/446:

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_android.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_getenv.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_platform.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_strcasecmp.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_writev.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(windows_port.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_android.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_getenv.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_platform.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_strcasecmp.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_writev.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(windows_port.c.o) has no symbols

timwoj avatar Jun 24 '22 23:06 timwoj

Is there something holding this from getting merged?

timwoj avatar Jul 27 '22 22:07 timwoj

Is this actually causing an issue on MacOS? Lots of platforms have these warnings with c-ares because c-ares compiles every file on every platform regardless of if it is used. Solving it on one platform leaves the rest untouched.

bradh352 avatar Jul 27 '22 22:07 bradh352

Is this actually causing an issue on MacOS?

Nothing beyond the annoying warnings.

Lots of platforms have these warnings with c-ares because c-ares compiles every file on every platform regardless of if it is used.

I didn't dig too far into the CMake configuration for c-ares, but a better fix would be to not include files that aren't needed for a platform. I can rework this PR to do that instead if you want me to go that way.

timwoj avatar Aug 04 '22 19:08 timwoj

I agree, however @bagder set a requirement that all build systems must use the same file for list of sources for all the various build systems we support (nmake makefiles, mingw makefiles, autotools, cmake ...). So you'll notice the weird CMake thing to read in Makefile.inc ... maybe we could add more variables to that file for per-platform files, but I'm not really sure if its worthwhile.

bradh352 avatar Aug 04 '22 19:08 bradh352