* [PATCH] prboom_2.5.0.bb: fix compilation failure due to undefined references.
@ 2010-10-11 6:23 Graham Gower
2010-10-11 6:34 ` Frans Meulenbroeks
0 siblings, 1 reply; 4+ messages in thread
From: Graham Gower @ 2010-10-11 6:23 UTC (permalink / raw)
To: openembedded-devel
Need to #define _GNU_SOURCE for sched.h to define CPU_ZERO/CPU_SET.
SDL/libsdldoom.a(i_system.o): In function `I_SetAffinityMask':
| i_system.c:(.text+0x7d4): undefined reference to `CPU_ZERO'
| i_system.c:(.text+0x7e8): undefined reference to `CPU_SET'
| collect2: ld returned 1 exit status
Signed-off-by: Graham Gower <graham.gower@gmail.com>
---
.../prboom-2.5.0/gnu_source_for_sched_h.patch | 12 ++++++++++++
recipes/prboom/prboom_2.5.0.bb | 3 ++-
2 files changed, 14 insertions(+), 1 deletions(-)
create mode 100644 recipes/prboom/prboom-2.5.0/gnu_source_for_sched_h.patch
diff --git a/recipes/prboom/prboom-2.5.0/gnu_source_for_sched_h.patch b/recipes/prboom/prboom-2.5.0/gnu_source_for_sched_h.patch
new file mode 100644
index 0000000..e77917a
--- /dev/null
+++ b/recipes/prboom/prboom-2.5.0/gnu_source_for_sched_h.patch
@@ -0,0 +1,12 @@
+Upstream: http://sourceforge.net/mailarchive/forum.php?thread_name=4CB2549C.2030100%40gmail.com&forum_name=prboom-devel
+
+--- prboom-2.5.0/src/SDL/i_system.c.orig 2010-10-11 09:58:02.000000000 +1030
++++ prboom-2.5.0/src/SDL/i_system.c 2010-10-11 09:59:16.000000000 +1030
+@@ -33,6 +33,7 @@
+ *-----------------------------------------------------------------------------
+ */
+
++#define _GNU_SOURCE
+ #include <stdio.h>
+
+ #include <stdarg.h>
diff --git a/recipes/prboom/prboom_2.5.0.bb b/recipes/prboom/prboom_2.5.0.bb
index 92a276d..13f3623 100644
--- a/recipes/prboom/prboom_2.5.0.bb
+++ b/recipes/prboom/prboom_2.5.0.bb
@@ -4,10 +4,11 @@ PRIORITY = "optional"
DEPENDS = "virtual/libsdl libsdl-mixer libsdl-net"
LICENSE = "GPL"
-PR = "r2"
+PR = "r3"
RRECOMMENDS_${PN} = "freedoom"
SRC_URI = "${SOURCEFORGE_MIRROR}/prboom/prboom-${PV}.tar.gz \
+ file://gnu_source_for_sched_h.patch \
"
inherit autotools
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] prboom_2.5.0.bb: fix compilation failure due to undefined references.
2010-10-11 6:23 [PATCH] prboom_2.5.0.bb: fix compilation failure due to undefined references Graham Gower
@ 2010-10-11 6:34 ` Frans Meulenbroeks
2010-10-11 9:24 ` Graham Gower
0 siblings, 1 reply; 4+ messages in thread
From: Frans Meulenbroeks @ 2010-10-11 6:34 UTC (permalink / raw)
To: openembedded-devel
2010/10/11 Graham Gower <graham.gower@gmail.com>:
> Need to #define _GNU_SOURCE for sched.h to define CPU_ZERO/CPU_SET.
>
> SDL/libsdldoom.a(i_system.o): In function `I_SetAffinityMask':
> | i_system.c:(.text+0x7d4): undefined reference to `CPU_ZERO'
> | i_system.c:(.text+0x7e8): undefined reference to `CPU_SET'
> | collect2: ld returned 1 exit status
>
> Signed-off-by: Graham Gower <graham.gower@gmail.com>
> ---
> .../prboom-2.5.0/gnu_source_for_sched_h.patch | 12 ++++++++++++
> recipes/prboom/prboom_2.5.0.bb | 3 ++-
> 2 files changed, 14 insertions(+), 1 deletions(-)
> create mode 100644 recipes/prboom/prboom-2.5.0/gnu_source_for_sched_h.patch
>
> diff --git a/recipes/prboom/prboom-2.5.0/gnu_source_for_sched_h.patch b/recipes/prboom/prboom-2.5.0/gnu_source_for_sched_h.patch
> new file mode 100644
> index 0000000..e77917a
> --- /dev/null
> +++ b/recipes/prboom/prboom-2.5.0/gnu_source_for_sched_h.patch
> @@ -0,0 +1,12 @@
> +Upstream: http://sourceforge.net/mailarchive/forum.php?thread_name=4CB2549C.2030100%40gmail.com&forum_name=prboom-devel
> +
> +--- prboom-2.5.0/src/SDL/i_system.c.orig 2010-10-11 09:58:02.000000000 +1030
> ++++ prboom-2.5.0/src/SDL/i_system.c 2010-10-11 09:59:16.000000000 +1030
> +@@ -33,6 +33,7 @@
> + *-----------------------------------------------------------------------------
> + */
> +
> ++#define _GNU_SOURCE
> + #include <stdio.h>
> +
> + #include <stdarg.h>
> diff --git a/recipes/prboom/prboom_2.5.0.bb b/recipes/prboom/prboom_2.5.0.bb
> index 92a276d..13f3623 100644
> --- a/recipes/prboom/prboom_2.5.0.bb
> +++ b/recipes/prboom/prboom_2.5.0.bb
> @@ -4,10 +4,11 @@ PRIORITY = "optional"
> DEPENDS = "virtual/libsdl libsdl-mixer libsdl-net"
> LICENSE = "GPL"
>
> -PR = "r2"
> +PR = "r3"
> RRECOMMENDS_${PN} = "freedoom"
>
> SRC_URI = "${SOURCEFORGE_MIRROR}/prboom/prboom-${PV}.tar.gz \
> + file://gnu_source_for_sched_h.patch \
> "
>
> inherit autotools
> --
> 1.7.1
>
Do you feel this is the preferred way?
I would probably not have made the patch but add -D_GNU_SOURCE to
CFLAGS. (I like to compile all the sources with the same flags to
avoid inconsistencies)
Frans
Frans
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] prboom_2.5.0.bb: fix compilation failure due to undefined references.
2010-10-11 6:34 ` Frans Meulenbroeks
@ 2010-10-11 9:24 ` Graham Gower
2010-10-11 11:30 ` Frans Meulenbroeks
0 siblings, 1 reply; 4+ messages in thread
From: Graham Gower @ 2010-10-11 9:24 UTC (permalink / raw)
To: openembedded-devel
On 11 October 2010 17:04, Frans Meulenbroeks
<fransmeulenbroeks@gmail.com> wrote:
> Do you feel this is the preferred way?
> I would probably not have made the patch but add -D_GNU_SOURCE to
> CFLAGS. (I like to compile all the sources with the same flags to
> avoid inconsistencies)
>
> Frans
To be honest, I didn't really think about it and don't care either
way. But the glibc manual says the following:
"You should define these macros by using ‘#define’ preprocessor
directives at the top of your source code files. These directives must
come before any #include of a system header file. It is best to make
them the very first thing in the file, preceded only by comments. You
could also use the ‘-D’ option to GCC, but it's better if you make the
source files indicate their own meaning in a self-contained way." [1]
The last sentence is not found in the feature_test_macros(7) man page.
-Graham
[1] http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] prboom_2.5.0.bb: fix compilation failure due to undefined references.
2010-10-11 9:24 ` Graham Gower
@ 2010-10-11 11:30 ` Frans Meulenbroeks
0 siblings, 0 replies; 4+ messages in thread
From: Frans Meulenbroeks @ 2010-10-11 11:30 UTC (permalink / raw)
To: openembedded-devel
2010/10/11 Graham Gower <graham.gower@gmail.com>:
> On 11 October 2010 17:04, Frans Meulenbroeks
> <fransmeulenbroeks@gmail.com> wrote:
>> Do you feel this is the preferred way?
>> I would probably not have made the patch but add -D_GNU_SOURCE to
>> CFLAGS. (I like to compile all the sources with the same flags to
>> avoid inconsistencies)
>>
>> Frans
>
> To be honest, I didn't really think about it and don't care either
> way. But the glibc manual says the following:
> "You should define these macros by using ‘#define’ preprocessor
> directives at the top of your source code files. These directives must
> come before any #include of a system header file. It is best to make
> them the very first thing in the file, preceded only by comments. You
> could also use the ‘-D’ option to GCC, but it's better if you make the
> source files indicate their own meaning in a self-contained way." [1]
>
> The last sentence is not found in the feature_test_macros(7) man page.
>
> -Graham
>
> [1] http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
Ah ok, didn't know that text.
My personal perception is to keep changes as small and unintrusive as
possible. That is why I generally prefer -D. With a new version the -D
will keep working whereas a patch might not (due to a change in the
src file).
But looking at that text, I'm fine with this change.
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-11 11:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-11 6:23 [PATCH] prboom_2.5.0.bb: fix compilation failure due to undefined references Graham Gower
2010-10-11 6:34 ` Frans Meulenbroeks
2010-10-11 9:24 ` Graham Gower
2010-10-11 11:30 ` Frans Meulenbroeks
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.