From Bugzilla Helper: User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2smp i686) Description of problem: here is a sample program: char res_init(); int main() { res_init(); return 0; } This gives the following results (sample program is ch.c compiling to conftest): [sibertsa@dopey w1]$ cc -o conftest -Wall ch.c /tmp/ccszaKJC.o: In function `main': /tmp/ccszaKJC.o(.text+0x7): undefined reference to `res_init' collect2: ld returned 1 exit status [sibertsa@dopey w1]$ This works on RedHat 7.0 i686 How reproducible: Always Steps to Reproduce: 1. See Description 2. 3. Actual Results: See Description Expected Results: expected sample program to compile successfully Additional info: This is straight RedHat 7.1 without any updates on a dual P2/300. The RH70 machine is a dual P3/800 and has most but recent updates (just haven't looked lately). I've looked through the errata for RH71 and don't see anything that would relate to this problem.
Your example program is buggy. You should simply never define prototypes provided by glibc, you should include proper header files instead (in this case <resolv.h>). That will take care of making it actually __res_init which is what glibc exports.
Sample program came from a configure script; here is its reasoning behind redefining the prototype: /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char res_init(); Interesting thing is that the compile returned no errors on RH70 whereas it did on RH71.
Then the configure script should be fixed. There really is no res_init in glibc, only __res_init (and res_init for binaries compiled against glibc 2.0 and glibc 2.1).
Before I make changes to the configure script, any idea why this compiles on RH70 and not on RH71? The configure script works correctly on RH70 and I need to make sure I don't mess something up for another platform or RH version.
The functionality of gcc or glibc (or maybe binutils) has changed. What changed to cause one or more to function differently than in RedHat 7.0? Either "it now does such-and-such" or "it no longer does such-and-such" but something has changed functionally. I see nothing in the Release Notes describing such functionality change.
res_init was deliberately removed from default symbol versions in glibc 2.2 to show that it should not be used (programs linked against it already will keep working, but no new programs can be linked against it). Glibc since 2.2 uses __res_init instead, programs which properly include <resolv.h> will compile just fine. The autoconf test if really needed could be e.g. test for AC_TRY_LINK_FUNC(res_init,...) and if that fails try AC_TRY_LINK_FUNC(__res_init,...).