[packages/poldek] fix building without optimization

draenog draenog at pld-linux.org
Mon Mar 24 12:04:08 CET 2014


commit 3e975db66a1929811eee8cc00bbc61621f7212d7
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Mon Mar 24 08:00:05 2014 +0000

    fix building without optimization
    
    It fixes two issues:
    1) poldek uses the traditional GNU semantics for inline functions, not
    the C99 one. Therefore builds with -00 fail with undefined references
    errors.
    
    2) _option_is_end is not exported by glibc. Builds with optimization
    succeed as it is also defined as an inline function in argp.h. The patch
    renders also Os-fail-workaround.patch not necessary.

 poldek-Os-fail-workaround.patch | 24 ------------------------
 poldek-glibc-internal.patch     | 31 +++++++++++++++++++++++++++++++
 poldek.spec                     |  4 ++--
 3 files changed, 33 insertions(+), 26 deletions(-)
---
diff --git a/poldek.spec b/poldek.spec
index d676fd0..bebd314 100644
--- a/poldek.spec
+++ b/poldek.spec
@@ -47,7 +47,7 @@ Source100:	%{name}-snap.conf
 Source101:	%{name}-multilib-snap.conf
 Source102:	%{name}-debuginfo-snap.conf
 Patch0:		%{name}-size-type.patch
-Patch1:		%{name}-Os-fail-workaround.patch
+Patch1:		%{name}-glibc-internal.patch
 Patch2:		%{name}-config.patch
 Patch3:		at-char-completion.patch
 Patch4:		%{name}-ignore-too-long-paths.patch
@@ -249,7 +249,7 @@ cd ../trurlib
 %{__automake}
 cd ..
 
-CPPFLAGS="%{rpmcppflags} -std=gnu99"
+CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
 %configure \
 	%{?with_static:--enable-static --disable-shared} \
 	%{!?with_imode:--disable-imode} \
diff --git a/poldek-Os-fail-workaround.patch b/poldek-Os-fail-workaround.patch
deleted file mode 100644
index 7bf430f..0000000
--- a/poldek-Os-fail-workaround.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- poldek-0.30/cli/shell.c~	2010-11-25 22:30:09.000000000 +0100
-+++ poldek-0.30/cli/shell.c	2011-02-06 20:20:23.502000232 +0100
-@@ -18,6 +18,13 @@
- # include "config.h"
- #endif
- 
-+#ifndef __USE_EXTERN_INLINES
-+# define __USE_EXTERN_INLINES
-+# include <argp.h>
-+# undef __USE_EXTERN_INLINES
-+#else
-+# include <argp.h>
-+#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
-@@ -28,7 +35,6 @@
- #include <sys/errno.h>
- #include <sys/param.h>
- #include <signal.h>
--#include <argp.h>
- #include <fnmatch.h>
- #include <unistd.h>
- 
diff --git a/poldek-glibc-internal.patch b/poldek-glibc-internal.patch
new file mode 100644
index 0000000..84f125e
--- /dev/null
+++ b/poldek-glibc-internal.patch
@@ -0,0 +1,31 @@
+commit c6c6020ba55a3a14fc2ca190c5623bf51ac0d8b6
+Author: Kacper Kornet <draenog at pld-linux.org>
+Date:   Mon Mar 24 06:58:32 2014 +0000
+
+    Don't use internal glibc function
+
+diff --git a/cli/shell.c b/cli/shell.c
+index bcd334a..58067e8 100644
+--- a/cli/shell.c
++++ b/cli/shell.c
+@@ -73,6 +73,11 @@ struct sh_ctx {
+ 
+ static struct sh_ctx sh_ctx = { COMPLETITION_CTX_NONE, NULL };
+ 
++inline static int option_is_end (const struct argp_option *__opt)
++{
++    return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
++}
++
+ static
+ int is_upgradeable(struct poclidek_ctx *cctx, struct pkg *pkg, int reverse)
+ {
+@@ -191,7 +196,7 @@ static char *command_options_generator(const char *text, int state)
+     
+         len = strlen(&text[2]);
+     
+-        for (i = 0; !_option_is_end(&command->argp_opts[i]); i++) {
++        for (i = 0; !option_is_end(&command->argp_opts[i]); i++) {
+             const struct argp_option *argp_opt = &command->argp_opts[i];
+         
+             /* skip hidden options */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/poldek.git/commitdiff/3e975db66a1929811eee8cc00bbc61621f7212d7



More information about the pld-cvs-commit mailing list