]> git.pld-linux.org Git - packages/poldek.git/commitdiff
fix building without optimization
authorKacper Kornet <draenog@pld-linux.org>
Mon, 24 Mar 2014 08:00:05 +0000 (08:00 +0000)
committerKacper Kornet <draenog@pld-linux.org>
Mon, 24 Mar 2014 10:00:52 +0000 (10:00 +0000)
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 [deleted file]
poldek-glibc-internal.patch [new file with mode: 0644]
poldek.spec

diff --git a/poldek-Os-fail-workaround.patch b/poldek-Os-fail-workaround.patch
deleted file mode 100644 (file)
index 7bf430f..0000000
+++ /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 (file)
index 0000000..84f125e
--- /dev/null
@@ -0,0 +1,31 @@
+commit c6c6020ba55a3a14fc2ca190c5623bf51ac0d8b6
+Author: Kacper Kornet <draenog@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 */
index d676fd050b654e7521182459a877c96942c6e86b..bebd314d8a9b222e8464ec02449f69c0745993c8 100644 (file)
@@ -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} \
This page took 0.24782 seconds and 4 git commands to generate.