This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[64bit] undefined references to _setjmp and _longjmp


/usr/include/machine/setjmp.h, which is included by /usr/include/setjmp.h, declares _setjmp and _longjmp, but ld reports "undefined reference":

$ cat test_setjmp.c
#include <setjmp.h>

int
main ()
{
  jmp_buf j;
  if (! _setjmp (j))
    _longjmp (j, 1);
  return 0;
}

$ gcc test_setjmp.c
/tmp/cciCClqa.o:test_setjmp.c:(.text+0x1d): undefined reference to `_setjmp'
/tmp/cciCClqa.o:test_setjmp.c:(.text+0x1d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_setjmp' /tmp/cciCClqa.o:test_setjmp.c:(.text+0x32): undefined reference to `_longjmp' /tmp/cciCClqa.o:test_setjmp.c:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_longjmp' /usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld: /tmp/cciCClqa.o: bad reloc address 0x0 in section `.pdata' /usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status

Ken


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]