emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: USE_LSB_TAG not supported on this platform


From: Herbert J. Skuhra
Subject: Re: USE_LSB_TAG not supported on this platform
Date: Tue, 09 Feb 2016 12:12:02 +0100
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/25.1 Mule/6.0 (HANACHIRUSATO)

On Tue, 09 Feb 2016 02:10:09 +0100,
Paul Eggert <address@hidden> wrote:
> 
> On 02/08/2016 03:01 PM, Herbert J. Skuhra wrote:
> > GCC 5 works but clang still fails. If I add
> > 
> > #define alignas _Alignas
> > 
> > to src/lisp.h the build succeeds.
> 
> Thanks, could you explain why that "#define" is helpful? On my
> platform (Fedora 23 x86-64, clang 3.7.0) clang's <stdalign.h>, which
> is in /usr/lib/clang/3.7.0/include/stdalign.h, contains this:
> 
> #ifndef __cplusplus
> #define alignas _Alignas
> #define alignof _Alignof
> #endif
> 
> and src/lisp.h includes <stdalign.h> before using or checking alignas,
> so there should be no need to add "#define alignas _Alignas" to
> lisp.h.

Checking for working stdalign.h fails with clang:

configure:28312: clang -c -g3 -O2    conftest.c >&5
conftest.c:309:30: error: 'test_double' declared as an array with a negative 
size
            char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
conftest.c:307:31: note: expanded from macro 'ao'
            # define ao(type) offsetof (struct { char a; type b; }, b)
                              ^
/usr/include/stddef.h:65:32: note: expanded from macro 'offsetof'
#define offsetof(type, member)  __offsetof(type, member)
                                ^
/usr/include/sys/cdefs.h:476:34: note: expanded from macro '__offsetof'
#define __offsetof(type, field)  __builtin_offsetof(type, field)
                                 ^
1 error generated.

If I modify the configure script as follows

--- configure.bak       2016-02-09 12:47:41.800783000 +0100
+++ configure   2016-02-09 12:48:06.230442000 +0100
@@ -28113,7 +28113,7 @@
 if ac_fn_c_try_compile "$LINENO"; then :
   gl_cv_header_working_stdalign_h=yes
 else
-  gl_cv_header_working_stdalign_h=no
+  gl_cv_header_working_stdalign_h=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi

the build succeeds.

> Is there a file src/stdalign.h in your build directory?

Yes, lib/stdalign.h.
(Not after modifying configure.)

> If so, why is it there, and why does it not define alignas?

Sorry, I couldn't figure it out yet. 

> Are you building with clang++?

No.

--
Herbert



reply via email to

[Prev in Thread] Current Thread [Next in Thread]