Index: ld/pass1.c =================================================================== --- ld/pass1.c (revision 280) +++ ld/pass1.c (working copy) @@ -6007,7 +6007,11 @@ * symbols and if found sets *(int *)fail_p. */ static int +#if __GLIBC_PREREQ(2,8) +symbol_address_compare (const void *a_p, const void *b_p, void *fail_p) +#else symbol_address_compare (void *fail_p, const void *a_p, const void *b_p) +#endif { const struct nlist * const * aa = a_p; const struct nlist * a = *aa; @@ -6158,8 +6162,11 @@ sst = allocate (sizeof (struct nlist *) * cur_obj->symtab->nsyms); for (i = 0; i < cur_obj->symtab->nsyms; i++) sst[i] = st + i; - qsort_r (sst, cur_obj->symtab->nsyms, sizeof (struct nlist *), &has_stabs, - symbol_address_compare); +#if __GLIBC_PREREQ(2,8) + qsort_r (sst, cur_obj->symtab->nsyms, sizeof (struct nlist *), symbol_address_compare, &has_stabs); +#else + qsort_r (sst, cur_obj->symtab->nsyms, sizeof (struct nlist *), &has_stabs, symbol_address_compare); +#endif if (has_stabs) { error_with_cur_obj("has both STABS and DWARF debugging info"); free (sst);