Author: kib
Date: Sat Feb  9 03:51:51 2019
New Revision: 343928
URL: https://svnweb.freebsd.org/changeset/base/343928

Log:
  Normalize the declaration of i386_read_exec variable.
  
  It is currently re-declared in sys/sysent.h which is a wrong place for
  MD variable.  Which causes redeclaration error with gcc when
  sys/sysent.h and machine/md_var.h are included both.
  
  Remove it from sys/sysent.h and instead include machine/md_var.h when
  needed, under #ifdef for both i386 and amd64.
  
  Reported and tested by:       bde
  Sponsored by: The FreeBSD Foundation
  MFC after:    1 week

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/sys/sysent.h
  head/sys/vm/vm_mmap.c
  head/sys/vm/vm_unix.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c  Sat Feb  9 03:00:00 2019        
(r343927)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Sat Feb  9 03:51:51 2019        
(r343928)
@@ -106,6 +106,9 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/cpu.h>
 #include <machine/elf.h>
+#ifdef __amd64__
+#include <machine/md_var.h>
+#endif
 
 #include <security/audit/audit.h>
 

Modified: head/sys/sys/sysent.h
==============================================================================
--- head/sys/sys/sysent.h       Sat Feb  9 03:00:00 2019        (r343927)
+++ head/sys/sys/sysent.h       Sat Feb  9 03:51:51 2019        (r343928)
@@ -163,10 +163,6 @@ extern struct sysentvec aout_sysvec;
 extern struct sysent sysent[];
 extern const char *syscallnames[];
 
-#if defined(__amd64__)
-extern int i386_read_exec;
-#endif
-
 #define        NO_SYSCALL (-1)
 
 struct module;

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c       Sat Feb  9 03:00:00 2019        (r343927)
+++ head/sys/vm/vm_mmap.c       Sat Feb  9 03:51:51 2019        (r343928)
@@ -74,6 +74,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/syscallsubr.h>
 #include <sys/sysent.h>
 #include <sys/vmmeter.h>
+#if defined(__amd64__) || defined(__i386__) /* for i386_read_exec */
+#include <machine/md_var.h>
+#endif
 
 #include <security/audit/audit.h>
 #include <security/mac/mac_framework.h>

Modified: head/sys/vm/vm_unix.c
==============================================================================
--- head/sys/vm/vm_unix.c       Sat Feb  9 03:00:00 2019        (r343927)
+++ head/sys/vm/vm_unix.c       Sat Feb  9 03:51:51 2019        (r343928)
@@ -55,6 +55,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysent.h>
 #include <sys/sysproto.h>
 #include <sys/systm.h>
+#if defined(__amd64__) || defined(__i386__) /* for i386_read_exec */
+#include <machine/md_var.h>
+#endif
 
 #include <vm/vm.h>
 #include <vm/vm_param.h>
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to