Ver Fonte

Merge remote-tracking branch 'origin/upstream'

Waldemar Brodkorb há 9 anos atrás
pai
commit
6a528e846b
2 ficheiros alterados com 45 adições e 42 exclusões
  1. 12 24
      Rules.mak
  2. 33 18
      libc/sysdeps/linux/mips/bits/siginfo.h

+ 12 - 24
Rules.mak

@@ -260,9 +260,17 @@ LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(call qstrip,$(UCLIBC_EXTRA_CFLAGS)))
 # Could use -Wl,--script,$(top_srcdir)extra/scripts/none.lds as well.
 $(eval $(call check-ld-var,--no-warn-mismatch))
 
+$(eval $(call cache-output-var,GCC_VER,$(CC) -dumpversion))
+GCC_VER := $(subst ., ,$(GCC_VER))
+GCC_MAJOR_VER ?= $(word 1,$(GCC_VER))
+GCC_MINOR_VER ?= $(word 2,$(GCC_VER))
+
 # Flags in OPTIMIZATION are used only for non-debug builds
 
 OPTIMIZATION:=
+OPTIMIZATION-$(GCC_MAJOR_VER):=
+OPTIMIZATION-$(GCC_MAJOR_VER).$(GCC_MINOR_VER):=
+
 # Use '-Os' optimization if available, else use -O2, allow Config to override
 $(eval $(call check-gcc-var,-Os))
 ifneq ($(CFLAG_-Os),)
@@ -273,31 +281,9 @@ OPTIMIZATION += $(CFLAG_-O2)
 endif
 # Use the gcc 3.4 -funit-at-a-time optimization when available
 $(eval $(call check-gcc-var,-funit-at-a-time))
-OPTIMIZATION += $(CFLAG_-funit-at-a-time)
-# shrinks code by about 0.1%
-$(eval $(call check-gcc-var,-fmerge-all-constants))
+OPTIMIZATION-3.4 += $(CFLAG_-funit-at-a-time)
 $(eval $(call check-gcc-var,-fstrict-aliasing))
-OPTIMIZATION += $(CFLAG_-fmerge-all-constants) $(CFLAG_-fstrict-aliasing)
-
-$(eval $(call cache-output-var,GCC_VER,$(CC) -dumpversion))
-GCC_VER := $(subst ., ,$(GCC_VER))
-GCC_MAJOR_VER ?= $(word 1,$(GCC_VER))
-#GCC_MINOR_VER ?= $(word 2,$(GCC_VER))
-
-ifneq ($(TARGET_ARCH),arc)
-ifeq ($(GCC_MAJOR_VER),4)
-# shrinks code, results are from 4.0.2
-# 0.36%
-$(eval $(call check-gcc-var,-fno-tree-loop-optimize))
-OPTIMIZATION += $(CFLAG_-fno-tree-loop-optimize)
-# 0.34%
-$(eval $(call check-gcc-var,-fno-tree-dominator-opts))
-OPTIMIZATION += $(CFLAG_-fno-tree-dominator-opts)
-# 0.1%
-$(eval $(call check-gcc-var,-fno-strength-reduce))
-OPTIMIZATION += $(CFLAG_-fno-strength-reduce)
-endif
-endif
+OPTIMIZATION += $(CFLAG_-fstrict-aliasing)
 
 # CPU_CFLAGS-y contain options which are not warnings,
 # not include or library paths, and not optimizations.
@@ -707,6 +693,8 @@ ifeq ($(DODEBUG),y)
 CFLAGS += -O0 -g3 -DDEBUG
 else
 CFLAGS += $(OPTIMIZATION)
+CFLAGS += $(OPTIMIZATION-$(GCC_MAJOR_VER))
+CFLAGS += $(OPTIMIZATION-$(GCC_MAJOR_VER).$(GCC_MINOR_VER))
 endif
 ifeq ($(DOSTRIP),y)
 LDFLAGS += -Wl,-s

+ 33 - 18
libc/sysdeps/linux/mips/bits/siginfo.h

@@ -69,6 +69,22 @@ typedef struct siginfo
 	    __uid_t si_uid;	/* Real user ID of sending process.  */
 	  } _kill;
 
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int si_tid;		/* Timer ID.  */
+	    int si_overrun;	/* Overrun count.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+
 	/* SIGCHLD.  */
 	struct
 	  {
@@ -83,29 +99,15 @@ typedef struct siginfo
 	struct
 	  {
 	    void *si_addr;	/* Faulting insn/memory ref.  */
+	    short int si_addr_lsb;	/* Valid LSB of the reported address.  */
 	  } _sigfault;
 
 	/* SIGPOLL.  */
 	struct
 	  {
-	    int si_band;	/* Band event for SIGPOLL.  */
+	    long int si_band;	/* Band event for SIGPOLL.  */
 	    int si_fd;
 	  } _sigpoll;
-
-	/* POSIX.1b timers.  */
-	struct
-	  {
-	    unsigned int _timer1;
-	    unsigned int _timer2;
-	  } _timer;
-
-	/* POSIX.1b signals.  */
-	struct
-	  {
-	    __pid_t si_pid;	/* Sending process ID.  */
-	    __uid_t si_uid;	/* Real user ID of sending process.  */
-	    sigval_t si_sigval;	/* Signal value.  */
-	  } _rt;
       } _sifields;
   } siginfo_t;
 
@@ -113,6 +115,8 @@ typedef struct siginfo
 /* X/Open requires some more fields with fixed names.  */
 # define si_pid		_sifields._kill.si_pid
 # define si_uid		_sifields._kill.si_uid
+# define si_timerid	_sifields._timer.si_tid
+# define si_overrun	_sifields._timer.si_overrun
 # define si_status	_sifields._sigchld.si_status
 # define si_utime	_sifields._sigchld.si_utime
 # define si_stime	_sifields._sigchld.si_stime
@@ -120,6 +124,7 @@ typedef struct siginfo
 # define si_int		_sifields._rt.si_sigval.sival_int
 # define si_ptr		_sifields._rt.si_sigval.sival_ptr
 # define si_addr	_sifields._sigfault.si_addr
+# define si_addr_lsb	_sifields._sigfault.si_addr_lsb
 # define si_band	_sifields._sigpoll.si_band
 # define si_fd		_sifields._sigpoll.si_fd
 
@@ -142,13 +147,14 @@ enum
 # define SI_ASYNCIO	SI_ASYNCIO
   SI_QUEUE,			/* Sent by sigqueue.  */
 # define SI_QUEUE	SI_QUEUE
-  SI_USER,			/* Sent by kill, sigsend, raise.  */
+  SI_USER,			/* Sent by kill, sigsend.  */
 # define SI_USER	SI_USER
   SI_KERNEL = 0x80		/* Send by kernel.  */
 #define SI_KERNEL	SI_KERNEL
 };
 
 
+# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* `si_code' values for SIGILL signal.  */
 enum
 {
@@ -207,10 +213,16 @@ enum
 # define BUS_ADRALN	BUS_ADRALN
   BUS_ADRERR,			/* Non-existant physical address.  */
 # define BUS_ADRERR	BUS_ADRERR
-  BUS_OBJERR			/* Object specific hardware error.  */
+  BUS_OBJERR,			/* Object specific hardware error.  */
 # define BUS_OBJERR	BUS_OBJERR
+  BUS_MCEERR_AR,		/* Hardware memory error: action required.  */
+#  define BUS_MCEERR_AR	BUS_MCEERR_AR
+  BUS_MCEERR_AO			/* Hardware memory error: action optional.  */
+#  define BUS_MCEERR_AO	BUS_MCEERR_AO
 };
+# endif
 
+# ifdef __USE_XOPEN_EXTENDED
 /* `si_code' values for SIGTRAP signal.  */
 enum
 {
@@ -219,7 +231,9 @@ enum
   TRAP_TRACE			/* Process trace trap.  */
 # define TRAP_TRACE	TRAP_TRACE
 };
+# endif
 
+# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
 /* `si_code' values for SIGCHLD signal.  */
 enum
 {
@@ -253,6 +267,7 @@ enum
   POLL_HUP			/* Device disconnected.  */
 # define POLL_HUP	POLL_HUP
 };
+# endif
 
 # undef __need_siginfo_t
 #endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */