unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14923: 24.3.50; Emacs compilation broken on FreeBSD SPARC/ARM platforms
@ 2013-07-21 12:54 Ashish SHUKLA
  2013-07-22 17:48 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Ashish SHUKLA @ 2013-07-21 12:54 UTC (permalink / raw)
  To: 14923


[-- Attachment #1.1: Type: text/plain, Size: 3285 bytes --]


Hi,

Following compiler error is observed on SPARC platform when compiling Emacs 24.3:

#v+
cc -std=gnu99 -c -I/usr/local/include -Demacs  -I. -I/home/ashish/emacs-nox11/work/emacs-24.3/src -I../lib -I/home/ashish/emacs-nox11/work/emacs-24.3/src/../lib               -MMD -MF deps/sysdep.d -MP     -O2 -pipe -fno-strict-aliasing sysdep.c
In file included from lisp.h:25,
                 from sysdep.c:39:
../lib/stdalign.h:51:1: warning: "_Alignof" redefined
In file included from /usr/include/string.h:36,
                 from ./conf_post.h:189,
                 from ./config.h:1671,
                 from sysdep.c:20:
/usr/include/sys/cdefs.h:240:1: warning: this is the location of the previous definition
In file included from lisp.h:25,
                 from sysdep.c:39:
../lib/stdalign.h:82:1: warning: "_Alignas" redefined
In file included from /usr/include/string.h:36,
                 from ./conf_post.h:189,
                 from ./config.h:1671,
                 from sysdep.c:20:
/usr/include/sys/cdefs.h:239:1: warning: this is the location of the previous definition
In file included from sysdep.c:89:
frame.h:86: error: redefinition of 'struct frame'
sysdep.c: In function 'list_system_processes':
sysdep.c:2684: warning: comparison is always true due to limited range of data type
sysdep.c:2684: warning: comparison is always true due to limited range of data type
sysdep.c: In function 'system_process_attributes':
sysdep.c:3264: warning: comparison is always true due to limited range of data type
sysdep.c:3264: warning: comparison is always true due to limited range of data type
sysdep.c:3272: warning: comparison is always true due to limited range of data type
sysdep.c:3272: warning: comparison is always true due to limited range of data type
sysdep.c:3312: warning: comparison is always true due to limited range of data type
sysdep.c:3312: warning: comparison is always true due to limited range of data type
sysdep.c:3313: warning: comparison is always true due to limited range of data type
sysdep.c:3313: warning: comparison is always true due to limited range of data type
sysdep.c:3314: warning: comparison is always true due to limited range of data type
sysdep.c:3314: warning: comparison is always true due to limited range of data type
sysdep.c:3322: warning: comparison is always true due to limited range of data type
sysdep.c:3322: warning: comparison is always true due to limited range of data type
sysdep.c:3346: warning: comparison is always true due to limited range of data type
sysdep.c:3346: warning: comparison is always true due to limited range of data type
gmake[1]: *** [sysdep.o] Error 1
#v-

This happens because Emacs' and FreeBSD's system header files define a type
`struct frame` which causes conflict. The attached diff file fixes this issue
by renaming the FreeBSD's type before it gets defined.

Following is the output of `uname -a`:

#v+
FreeBSD magnus 9.1-STABLE FreeBSD 9.1-STABLE #4 r252102: Sun Jun 23 10:25:50 EDT 2013     root@magnus:/usr/obj/usr/src/sys/GENERIC  sparc64
=v-


Thanks
-- 
Ashish SHUKLA

“Censorship is telling a man he can't have a steak just because a baby can't
chew it.” (patcito, identi.ca #62762642)

Sent from my Emacs

[-- Attachment #1.2: diff file --]
[-- Type: text/plain, Size: 488 bytes --]


$FreeBSD$

--- src/sysdep.c.orig
+++ src/sysdep.c
@@ -46,7 +46,15 @@
 #endif
 
 #ifdef __FreeBSD__
+#include <sys/sysctl.h>
+/* machine/frame.h in Sparc/ARM has 'struct frame' which conflicts with Emacs' 'struct frame', so rename it */
+#if defined(__sparc__) || defined(__arm__)
+#define frame freebsd_sparc_frame
+#endif
 #include <sys/user.h>
+#if defined(__sparc__) || defined(__arm__)
+#undef frame
+#endif
 #include <sys/resource.h>
 #include <math.h>
 #endif

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* bug#14923: 24.3.50; Emacs compilation broken on FreeBSD SPARC/ARM platforms
  2013-07-21 12:54 bug#14923: 24.3.50; Emacs compilation broken on FreeBSD SPARC/ARM platforms Ashish SHUKLA
@ 2013-07-22 17:48 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2013-07-22 17:48 UTC (permalink / raw)
  To: 14923-done; +Cc: ashish.is

Thanks, I installed a fix in the trunk (bzr 113491) along the
lines you suggested and am marking this as done.

The _Alignof/_Alignas issue was fixed earlier in
the trunk (bzr 113322).

The other noise is harmless and should be fixed
once FreeBSD fixes their compiler (a later GCC
version, perhaps? I don't know the FreeBSD
compiler technology these days).





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

end of thread, other threads:[~2013-07-22 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-21 12:54 bug#14923: 24.3.50; Emacs compilation broken on FreeBSD SPARC/ARM platforms Ashish SHUKLA
2013-07-22 17:48 ` 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).