unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Building master on Windows fails with undefined reference to `__builtin_assume_aligned'
@ 2016-06-25  8:17 martin rudalics
  2016-06-25 21:40 ` Paul Eggert
  0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2016-06-25  8:17 UTC (permalink / raw)
  To: emacs-devel

A CFLAGS='-O3' build of master currently fails on my Windows XP thusly:

....
....
....
make[2]: Leaving directory `/c/emacs-git/trunk/opt/admin/charsets'
   CC       firstfile.o
   CC       dispnew.o
In file included from ../../src/dispnew.c:26:0:
../../src/lisp.h: In function 'XUNTAG':
../../src/lisp.h:878:3: warning: implicit declaration of function '__builtin_assume_aligned' [-Wimplicit-function-declaration]
../../src/lisp.h:878:3: warning: return makes pointer from integer without a cast [enabled by default]
   CC       frame.o
In file included from ../../src/frame.c:28:0:
../../src/lisp.h: In function 'XUNTAG':
../../src/lisp.h:878:3: warning: implicit declaration of function '__builtin_assume_aligned' [-Wimplicit-function-declaration]
../../src/lisp.h:878:3: warning: return makes pointer from integer without a cast [enabled by default]
make[2]: Entering directory `/c/emacs-git/trunk/opt/admin/charsets'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/c/emacs-git/trunk/opt/admin/charsets'
   CC       scroll.o
....
....
....
   CC       tparam.o
In file included from ../../src/tparam.c:21:0:
../../src/lisp.h: In function 'XUNTAG':
../../src/lisp.h:878:3: warning: implicit declaration of function '__builtin_assume_aligned' [-Wimplicit-function-declaration]
../../src/lisp.h:878:3: warning: return makes pointer from integer without a cast [enabled by default]
   CC       lastfile.o
In file included from ../../src/lastfile.c:39:0:
../../src/lisp.h: In function 'XUNTAG':
../../src/lisp.h:878:3: warning: implicit declaration of function '__builtin_assume_aligned' [-Wimplicit-function-declaration]
../../src/lisp.h:878:3: warning: return makes pointer from integer without a cast [enabled by default]
   CCLD     temacs.exe
dispnew.o:dispnew.c:(.text+0x75): undefined reference to `__builtin_assume_aligned'
dispnew.o:dispnew.c:(.text+0xbd): undefined reference to `__builtin_assume_aligned'
dispnew.o:dispnew.c:(.text+0xe1): undefined reference to `__builtin_assume_aligned'
dispnew.o:dispnew.c:(.text+0x116): undefined reference to `__builtin_assume_aligned'
dispnew.o:dispnew.c:(.text+0x13f): undefined reference to `__builtin_assume_aligned'
dispnew.o:dispnew.c:(.text+0x212): more undefined references to `__builtin_assume_aligned' follow
collect2: ld returned 1 exit status
make[1]: *** [temacs.exe] Error 1
make[1]: Leaving directory `/c/emacs-git/trunk/opt/src'
make: *** [src] Error 2

Help appreciated, martin



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building master on Windows fails with undefined reference to `__builtin_assume_aligned'
  2016-06-25  8:17 Building master on Windows fails with undefined reference to `__builtin_assume_aligned' martin rudalics
@ 2016-06-25 21:40 ` Paul Eggert
  2016-06-26  9:00   ` martin rudalics
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Eggert @ 2016-06-25 21:40 UTC (permalink / raw)
  To: martin rudalics, emacs-devel

On 06/25/2016 10:17 AM, martin rudalics wrote:
> ../../src/lisp.h:878:3: warning: implicit declaration of function 
> '__builtin_assume_aligned' [-Wimplicit-function-declaration] 

What version of GCC are you using? What are the values of the C macros 
__GNUC__, __GNUC_MINOR__, and __GNUC_PATCHLEVEL__? Currently, 
src/conf_post.h has this:

# define __has_builtin___builtin_assume_aligned GNUC_PREREQ (4, 7, 0)

which means the code assumes that GCC 4.7.0 and later support 
__builtin_assume_aligned (I got this from the GCC NEWS files). Perhaps 
that "(4, 7, 0)" is too low and needs to be increased a bit?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building master on Windows fails with undefined reference to `__builtin_assume_aligned'
  2016-06-25 21:40 ` Paul Eggert
@ 2016-06-26  9:00   ` martin rudalics
  2016-06-26 10:52     ` Paul Eggert
  0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2016-06-26  9:00 UTC (permalink / raw)
  To: Paul Eggert, emacs-devel

 >> ../../src/lisp.h:878:3: warning: implicit declaration of function '__builtin_assume_aligned' [-Wimplicit-function-declaration]
 >
 > What version of GCC are you using?

gcc (GCC) 4.6.2

 > What are the values of the C macros __GNUC__,

4

 > __GNUC_MINOR__,

6

 > and __GNUC_PATCHLEVEL__?

2

(as expected I believe).

 > Currently, src/conf_post.h has this:
 >
 > # define __has_builtin___builtin_assume_aligned GNUC_PREREQ (4, 7, 0)
 >
 > which means the code assumes that GCC 4.7.0 and later support __builtin_assume_aligned (I got this from the GCC NEWS files). Perhaps that "(4, 7, 0)" is too low and needs to be increased a bit?

Something else must be at work here.  Note that I do not get the errors
with CFLAGS='-O0 -g2 -gdwarf-2' (from my debug-build options).

martin



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building master on Windows fails with undefined reference to `__builtin_assume_aligned'
  2016-06-26  9:00   ` martin rudalics
@ 2016-06-26 10:52     ` Paul Eggert
  2016-06-26 12:46       ` martin rudalics
  2016-06-26 16:01       ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Eggert @ 2016-06-26 10:52 UTC (permalink / raw)
  To: martin rudalics, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 656 bytes --]

On 06/26/2016 11:00 AM, martin rudalics wrote:
> Something else must be at work here.  Note that I do not get the errors
> with CFLAGS='-O0 -g2 -gdwarf-2' (from my debug-build options). 

It's odd that you do not get the errors in that case. Perhaps you are 
invoking a different version of GCC when you compile with -O3? If so, 
it's possible you'll have problems elsewhere too; in general if you 
configure with GCC version X, then you may run into problems if you then 
build Emacs with some other GCC version.

> gcc (GCC) 4.6.2 

Thanks, that helped identify a typo that is most likely causing your 
problem. I installed the attached patch to fix it.

[-- Attachment #2: 0001-Fix-GNUC_PREREQ-off-by-1-typo.patch --]
[-- Type: text/x-patch, Size: 1023 bytes --]

From 6eeccbb96f0af524fd77c6a9dea0456e52682638 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 26 Jun 2016 12:44:39 +0200
Subject: [PATCH] Fix GNUC_PREREQ off-by-1 typo

Problem reported by Martin Rudalics in:
http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00587.html
* src/conf_post.h (GNUC_PREREQ) [__GNUC_PATCHLEVEL__]:
Fix < vs <= typo.
---
 src/conf_post.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf_post.h b/src/conf_post.h
index 7aa5bae..69b981f 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -42,7 +42,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 # define GNUC_PREREQ(v, w, x) ((v) < __GNUC__ + ((w) <= __GNUC_MINOR__))
 #else
 # define GNUC_PREREQ(v, w, x) \
-    ((v) < __GNUC__ + ((w) <= __GNUC_MINOR__ + ((x) <= __GNUC_PATCHLEVEL__)))
+    ((v) < __GNUC__ + ((w) < __GNUC_MINOR__ + ((x) <= __GNUC_PATCHLEVEL__)))
 #endif
 
 /* The type of bool bitfields.  Needed to compile Objective-C with
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: Building master on Windows fails with undefined reference to `__builtin_assume_aligned'
  2016-06-26 10:52     ` Paul Eggert
@ 2016-06-26 12:46       ` martin rudalics
  2016-06-26 16:01       ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: martin rudalics @ 2016-06-26 12:46 UTC (permalink / raw)
  To: Paul Eggert, emacs-devel

 > It's odd that you do not get the errors in that case. Perhaps you are
 > invoking a different version of GCC when you compile with -O3? If so,
 > it's possible you'll have problems elsewhere too; in general if you
 > configure with GCC version X, then you may run into problems if you
 > then build Emacs with some other GCC version.

I have only one GCC version installed here.

 >> gcc (GCC) 4.6.2
 >
 > Thanks, that helped identify a typo that is most likely causing your problem. I installed the attached patch to fix it.

It builds now.

Thanks you, martin



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building master on Windows fails with undefined reference to `__builtin_assume_aligned'
  2016-06-26 10:52     ` Paul Eggert
  2016-06-26 12:46       ` martin rudalics
@ 2016-06-26 16:01       ` Eli Zaretskii
  2016-06-26 20:25         ` Paul Eggert
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-06-26 16:01 UTC (permalink / raw)
  To: Paul Eggert; +Cc: rudalics, emacs-devel

> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sun, 26 Jun 2016 12:52:07 +0200
> 
> > gcc (GCC) 4.6.2 
> 
> Thanks, that helped identify a typo that is most likely causing your 
> problem. I installed the attached patch to fix it.

Shouldn't we make some change in this branch as well:

  #elif ! defined __GNUC_PATCHLEVEL__
  # define GNUC_PREREQ(v, w, x) ((v) < __GNUC__ + ((w) <= __GNUC_MINOR__))

My reading of this is that GNUC_PREREQ (4, 7, 2) will be satisfied by
GCC 4.7.0, whereas it should be satisfied by 4.8.0.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building master on Windows fails with undefined reference to `__builtin_assume_aligned'
  2016-06-26 16:01       ` Eli Zaretskii
@ 2016-06-26 20:25         ` Paul Eggert
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Eggert @ 2016-06-26 20:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rudalics, emacs-devel

On 06/26/2016 06:01 PM, Eli Zaretskii wrote:
> Shouldn't we make some change in this branch as well:
>
>    #elif ! defined __GNUC_PATCHLEVEL__
>    # define GNUC_PREREQ(v, w, x) ((v) < __GNUC__ + ((w) <= __GNUC_MINOR__))
Thanks, I installed a patch for that.

(The bug wasn't triggered by Emacs, since the problem occurred only for 
GCC 2.8.1 (1998) and earlier when v <= 2 and x != 0, and no uses of 
GCC_PREREQ in Emacs are like that.)



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-26 20:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-25  8:17 Building master on Windows fails with undefined reference to `__builtin_assume_aligned' martin rudalics
2016-06-25 21:40 ` Paul Eggert
2016-06-26  9:00   ` martin rudalics
2016-06-26 10:52     ` Paul Eggert
2016-06-26 12:46       ` martin rudalics
2016-06-26 16:01       ` Eli Zaretskii
2016-06-26 20:25         ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).