Skip to contentSkip to conversation

empty: fix compile with toolchain w/o threads

PATCH New Waldemar Brodkorb 2 participants 5 messages Jul 9, 2015 – Aug 10, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 empty: fix compile with toolchain w/o threads

As found via autobuilders and discussed on the list, the ifdef is wrong, as empty uses SysV semaphores and not POSIX semaphores.

Tested with glibc/uclibc-ng builds. And with uclibc-ng without threads.

---
 package/empty/0002-fix-non-thread-build.patch |   49 +++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 package/empty/0002-fix-non-thread-build.patch
package/empty/0002-fix-non-thread-build.patch new file +49 -0
new file mode 100644
index 0000000..4854d86
@@ -0,0 +1,49 @@
+empty uses SysV semaphores, so the ifdef is wrong here.
+
+Signed-off-by: Waldemar Brodkorb <[email protected]>
+
+--- empty-0.6.19b.orig/empty.c	2012-09-19 13:24:05.000000000 +0200
++++ empty-0.6.19b/empty.c	2015-07-09 02:00:09.000000000 +0200
+@@ -179,25 +179,23 @@ int main (int argc, char *argv[]) {
+ 					   2 - unknown */
+ 	
+ /* semaphores */
+-#ifdef _POSIX_SEMAPHORES
+-	#if defined(__linux__) && defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
+-		/* union semun is defined by including <sys/sem.h> */
+-	#else
+-		union semun {
+-			int val;
+-			struct semid_ds *buf;
+-		#ifdef __SVR4
+-			ushort_t	*array;
+-		#endif
+-		#ifdef __hpux__
+-			ushort		*array;
+-		#endif
+-		#ifdef __linux__
+-			unsigned short *array;
+-			struct seminfo *__buf;		/* buffer for IPC_INFO */
+-		#endif
+-		};
+-  	#endif
++#if defined(__linux__) && defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
++	/* union semun is defined by including <sys/sem.h> */
++#else
++	union semun {
++		int val;
++		struct semid_ds *buf;
++	#ifdef __SVR4
++		ushort_t	*array;
++	#endif
++	#ifdef __hpux__
++		ushort		*array;
++	#endif
++	#ifdef __linux__
++		unsigned short *array;
++		struct seminfo *__buf;		/* buffer for IPC_INFO */
++	#endif
++	};
+ #endif
+ 	union semun semu;
+ 	
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 empty: fix compile with toolchain w/o threads

Dear Waldemar Brodkorb,

Quoted 4 lines · Waldemar Brodkorb

As found via autobuilders and discussed on the list, the ifdef is wrong, as empty uses SysV semaphores and not POSIX semaphores.

Quoted 8 lines

Tested with glibc/uclibc-ng builds. And with uclibc-ng without threads.

---
 package/empty/0002-fix-non-thread-build.patch |   49 +++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 package/empty/0002-fix-non-thread-build.patch

Applied, thanks. Could you submit the patch upstream?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 empty: fix compile with toolchain w/o threads

Hi,
Thomas Petazzoni wrote,

Quoted 10 lines

Dear Waldemar Brodkorb,

Quoted 7 lines · Waldemar Brodkorb

As found via autobuilders and discussed on the list, the ifdef is wrong, as empty uses SysV semaphores and not POSIX semaphores.

Tested with glibc/uclibc-ng builds. And with uclibc-ng without threads.

Quoted 7 lines
Quoted 5 lines
---
 package/empty/0002-fix-non-thread-build.patch |   49 +++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 package/empty/0002-fix-non-thread-build.patch

Applied, thanks. Could you submit the patch upstream?

I sent it to Mikhail Zakharov and he mailed me back that he has applied it.

best regards
Waldemar

#3 lore raw

PATCH 1/1 empty: fix compile with toolchain w/o threads

Waldemar,

Quoted 2 lines · Waldemar Brodkorb

I sent it to Mikhail Zakharov and he mailed me back that he has applied it.

Excellent, thanks! I see he has done a new release 0.6.20b a few hours ago. Can you check whether it includes the fix?

The previous release was from 2012, so I wasn't really expecting to see a new release anytime soon.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 empty: fix compile with toolchain w/o threads

Hi Thomas,
Thomas Petazzoni wrote,

Quoted 4 lines

Waldemar,

On Mon, 10 Aug 2015 20:01:53 +0200, Waldemar Brodkorb wrote:

Quoted 8 lines
Quoted 2 lines

I sent it to Mikhail Zakharov and he mailed me back that he has applied it.

Excellent, thanks! I see he has done a new release 0.6.20b a few hours ago. Can you check whether it includes the fix?

The previous release was from 2012, so I wasn't really expecting to see a new release anytime soon.

Yes, indeed, patch is included.

best regards
Waldemar