This is the mail archive of the cygwin-developers 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]

Re: undefined reference to `strlwr' on 64bit Cygwin


On 3/17/2013 5:51 AM, Corinna Vinschen wrote:
On Mar 16 22:08, Ken Brown wrote:
$ uname -a
CYGWIN_NT-6.1 fiona 1.7.18(0.263/5/3) 2013-03-15 16:35 x86_64 Cygwin

$ gcc --version
gcc (GCC) 4.8.0 20130307 (experimental)

$ cat strlwr_test.c
#include <string.h>
#include <stdio.h>

int
main ()
{
   char str[] = "FRED";
   printf ("%s\n", strlwr (str));
}

$ gcc strlwr_test.c
/tmp/ccW2SOn8.o:strlwr_test.c:(.text+0x20): undefined reference to `strlwr'
/tmp/ccW2SOn8.o:strlwr_test.c:(.text+0x20): relocation truncated to
fit: R_X86_64_PC32 against undefined symbol `strlwr'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
/tmp/ccW2SOn8.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

Thanks for the hint, I added it back to cygwin64.din.


However, do you really use this function?  It's broken by design.  In
theory it's one of those functions which should never have been exported
since it only works on single-byte charsets and glibc rightfully doesn't
provide it at all.  If you use it with UTF-8 non-ASCII chars, the result
is random nonsense.

It's used in the cygw32 build of emacs, in w32font.c. The native Windows build uses _strlwr, and Daniel added `#define _strlwr strlwr' for Cygwin. Maybe he can comment on this.


Ken


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