* Re: Revision 103880 broke the Windows build
2011-04-10 18:29 ` Paul Eggert
@ 2011-04-10 18:48 ` Sudish Joseph
2011-04-10 18:52 ` chad
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Sudish Joseph @ 2011-04-10 18:48 UTC (permalink / raw)
To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel
Paul Eggert <eggert@cs.ucla.edu> writes:
> On 04/10/2011 11:17 AM, Eli Zaretskii wrote:
>> Here's the error message:
>>
>> oo-spd/i386/temacs2.a(xdisp.o)(.text+0x277ba): In function `message':
>> D:\gnu\bzr\emacs\trunk\src/xdisp.c:8420: undefined reference to `strnlen'
>
> Windows has strnlen, according to
> <http://msdn.microsoft.com/en-us/library/z50ty2zh%28v=vs.80%29.aspx>.
> So why does the build fail on Windows?
>
> I suppose we can add a replacement for strnlen on Windows, but that
> would be pretty odd if Windows already had it.
Likewise for OS X 10.6.6:
Undefined symbols for architecture x86_64:
"_strnlen", referenced from:
_message in xdisp.o
ld: symbol(s) not found for architecture x86_64
Googling for "strnlen os x" returns many hits asserting that *BSD and OS
X don't have it.
-Sudish
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Revision 103880 broke the Windows build
2011-04-10 18:29 ` Paul Eggert
2011-04-10 18:48 ` Sudish Joseph
@ 2011-04-10 18:52 ` chad
2011-04-10 19:01 ` Eli Zaretskii
2011-04-10 19:53 ` Andy Moreton
3 siblings, 0 replies; 8+ messages in thread
From: chad @ 2011-04-10 18:52 UTC (permalink / raw)
To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel
On Apr 10, 2011, at 11:29 AM, Paul Eggert wrote:
> On 04/10/2011 11:17 AM, Eli Zaretskii wrote:
>> Here's the error message:
>>
>> oo-spd/i386/temacs2.a(xdisp.o)(.text+0x277ba): In function `message':
>> D:\gnu\bzr\emacs\trunk\src/xdisp.c:8420: undefined reference to `strnlen'
Nextstep also:
gcc -Demacs -DHAVE_CONFIG_H -I. -I/Users/yandros/Project/emacs/working/src -I../lib -I/Users/yandros/Project/emacs/working/src/../lib -MMD -MF deps/.d -Wimplicit-function-declaration -Wold-style-definition -Wdeclaration-after-statement -g -O2 -prebind -framework AppKit -Xlinker -headerpad -Xlinker 6C8 \
-o temacs pre-crt0.o dispnew.o frame.o scroll.o xdisp.o menu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexmacosx.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o atimer.o intervals.o textprop.o composite.o xml.o fontset.o fringe.o image.o nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o terminfo.o lastfile.o ../lib/libgnu.a -lresolv -lncurses
Undefined symbols:
"_strnlen", referenced from:
_message in xdisp.o
ld: symbol(s) not found
I haven't had a chance to look into it more, yet.
I also had to rerun autogen.sh, to get around an error in configure (which is why I didn't look into it yet).
Hope that's helpful,
*Chad
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Revision 103880 broke the Windows build
2011-04-10 18:29 ` Paul Eggert
2011-04-10 18:48 ` Sudish Joseph
2011-04-10 18:52 ` chad
@ 2011-04-10 19:01 ` Eli Zaretskii
2011-04-10 19:53 ` Paul Eggert
2011-04-10 19:53 ` Andy Moreton
3 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2011-04-10 19:01 UTC (permalink / raw)
To: Paul Eggert; +Cc: emacs-devel
> Date: Sun, 10 Apr 2011 11:29:07 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: emacs-devel@gnu.org
>
> On 04/10/2011 11:17 AM, Eli Zaretskii wrote:
> > Here's the error message:
> >
> > oo-spd/i386/temacs2.a(xdisp.o)(.text+0x277ba): In function `message':
> > D:\gnu\bzr\emacs\trunk\src/xdisp.c:8420: undefined reference to `strnlen'
>
> Windows has strnlen, according to
> <http://msdn.microsoft.com/en-us/library/z50ty2zh%28v=vs.80%29.aspx>.
> So why does the build fail on Windows?
You are reading MSDN for one of the latest versions of the runtime.
Not everyone has that installed; mine is compatible with VS.71, not
VS.80. Try the "Other versions" link there.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Revision 103880 broke the Windows build
2011-04-10 19:01 ` Eli Zaretskii
@ 2011-04-10 19:53 ` Paul Eggert
2011-04-10 20:48 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Paul Eggert @ 2011-04-10 19:53 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On 04/10/2011 12:01 PM, Eli Zaretskii wrote:
> You are reading MSDN for one of the latest versions of the runtime.
> Not everyone has that installed
Ah, OK, thanks. I committed the following, which uses
memchr instead. Other w32 already uses memchr so memchr
should be OK. A quick Google search says MacOS has it
too.
=== modified file 'src/ChangeLog'
--- src/ChangeLog 2011-04-10 19:12:28 +0000
+++ src/ChangeLog 2011-04-10 19:47:49 +0000
@@ -1,5 +1,7 @@
2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
+ * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
+
Fix more problems found by GCC 4.6.0's static checks.
* xdisp.c (vmessage): Use a better test for character truncation.
=== modified file 'src/xdisp.c'
--- src/xdisp.c 2011-04-10 02:27:15 +0000
+++ src/xdisp.c 2011-04-10 19:47:49 +0000
@@ -8417,10 +8417,13 @@
/* Do any truncation at a character boundary. */
if (! (0 <= len && len < bufsize))
- for (len = strnlen (buf, bufsize);
- len && ! CHAR_HEAD_P (buf[len - 1]);
- len--)
- continue;
+ {
+ char *end = memchr (buf, 0, bufsize);
+ for (len = end ? end - buf : bufsize;
+ len && ! CHAR_HEAD_P (buf[len - 1]);
+ len--)
+ continue;
+ }
message2 (FRAME_MESSAGE_BUF (f), len, 0);
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Revision 103880 broke the Windows build
2011-04-10 19:53 ` Paul Eggert
@ 2011-04-10 20:48 ` Eli Zaretskii
0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2011-04-10 20:48 UTC (permalink / raw)
To: Paul Eggert; +Cc: emacs-devel
> Date: Sun, 10 Apr 2011 12:53:50 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: emacs-devel@gnu.org
>
> On 04/10/2011 12:01 PM, Eli Zaretskii wrote:
> > You are reading MSDN for one of the latest versions of the runtime.
> > Not everyone has that installed
>
> Ah, OK, thanks. I committed the following, which uses
> memchr instead. Other w32 already uses memchr so memchr
> should be OK. A quick Google search says MacOS has it
> too.
Thanks, the Windows port builds okay now.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Revision 103880 broke the Windows build
2011-04-10 18:29 ` Paul Eggert
` (2 preceding siblings ...)
2011-04-10 19:01 ` Eli Zaretskii
@ 2011-04-10 19:53 ` Andy Moreton
3 siblings, 0 replies; 8+ messages in thread
From: Andy Moreton @ 2011-04-10 19:53 UTC (permalink / raw)
To: emacs-devel
On Sun 10 Apr 2011, Paul Eggert wrote:
> On 04/10/2011 11:17 AM, Eli Zaretskii wrote:
>> Here's the error message:
>>
>> oo-spd/i386/temacs2.a(xdisp.o)(.text+0x277ba): In function `message':
>> D:\gnu\bzr\emacs\trunk\src/xdisp.c:8420: undefined reference to `strnlen'
>
> Windows has strnlen, according to
> <http://msdn.microsoft.com/en-us/library/z50ty2zh%28v=vs.80%29.aspx>.
> So why does the build fail on Windows?
>
> I suppose we can add a replacement for strnlen on Windows, but that
> would be pretty odd if Windows already had it.
The mingw import libs do not appear to support strnlen().
Looking at the DLLs installed in C:\WINDOWS\System32 on my WinXP system,
only msvcr100.dll exports strnlen(). This appears to be a part of the
Visual Studio 2010 redistributables:
http://msdn.microsoft.com/en-us/library/8kche8ah.aspx
A replacement seems necessary (or revert the changes).
AndyM
^ permalink raw reply [flat|nested] 8+ messages in thread