Patchwork [3/3] apr: fix incorrect size of pid_t

login
register
mail settings
Submitter Paul Eggleton
Date June 28, 2012, 6:29 p.m.
Message ID <1fb664d76463830cf80997e2e13891adfff7a6eb.1340908084.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/30819/
State New
Headers show

Comments

Paul Eggleton - June 28, 2012, 6:29 p.m.
If cross-compiling, apr's configure script assumes that pid_t is
64-bit which is wrong - it appears that 32-bit is a safe assumption
for Linux, so use that instead.

This fixes Apache writing garbage to its pid file when built using apr
produced from this recipe.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/recipes-support/apr/apr_1.4.6.bb |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Khem Raj - June 29, 2012, 2:47 a.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 6/28/2012 11:29 AM, Paul Eggleton wrote:
> If cross-compiling, apr's configure script assumes that pid_t is 
> 64-bit which is wrong - it appears that 32-bit is a safe
> assumption for Linux, so use that instead.
> 
> This fixes Apache writing garbage to its pid file when built using
> apr produced from this recipe.
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> --- 
> meta/recipes-support/apr/apr_1.4.6.bb |    4 +++- 1 file changed, 3
> insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-support/apr/apr_1.4.6.bb
> b/meta/recipes-support/apr/apr_1.4.6.bb index 54c47fe..8af5411
> 100644 --- a/meta/recipes-support/apr/apr_1.4.6.bb +++
> b/meta/recipes-support/apr/apr_1.4.6.bb @@ -9,7 +9,7 @@
> LIC_FILES_CHKSUM =
> "file://LICENSE;md5=0c35ff3c4c83b89d2f076e315caac28b \
> 
> BBCLASSEXTEND = "native"
> 
> -PR = "r0" +PR = "r1"
> 
> SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \ 
> file://configure_fixes.patch \ @@ -23,6 +23,8 @@ inherit autotools
> lib_package binconfig multilib_header
> 
> OE_BINCONFIG_EXTRA_MANGLE = " -e
> 's:location=source:location=installed:'"
> 
> +EXTRA_OECONF_append_class-target = " ac_cv_sizeof_pid_t=4" +

I think this may not be correct thing for 64bit targets. You are
better of adding this to appropriate site files.


> do_configure_prepend() { cd ${S} ./buildconf
> 


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/tF0MACgkQuwUzVZGdMxSXNACfUhw2qkbBYBL/mBIvJ5zwIla7
ojoAoICsjsBSRzJlS7s6Qg3i8Ze+NBQo
=yxut
-----END PGP SIGNATURE-----
Paul Eggleton - June 29, 2012, 10:50 a.m.
On Thursday 28 June 2012 19:47:31 Khem Raj wrote:
> I think this may not be correct thing for 64bit targets. You are
> better of adding this to appropriate site files.

pid_t is apparently always an int on Linux and our siteinfo files state that 
ac_cv_sizeof_int is 4 for every target. Nevertheless, if we see the need to 
define ac_cv_sizeof_int even though the value isn't currently different 
anywhere, it seems at least consistent to set ac_cv_sizeof_pid_t there as 
well.

However, I can't help feeling that these files are a bit of a mess and it's not 
totally clear to me where I should be putting this value. Should it go in 
common-linux? Or do I have to add it to the specific site file for every arch?

Cheers,
Paul
Richard Purdie - June 29, 2012, 11:33 a.m.
On Fri, 2012-06-29 at 11:50 +0100, Paul Eggleton wrote:
> On Thursday 28 June 2012 19:47:31 Khem Raj wrote:
> > I think this may not be correct thing for 64bit targets. You are
> > better of adding this to appropriate site files.
> 
> pid_t is apparently always an int on Linux and our siteinfo files state that 
> ac_cv_sizeof_int is 4 for every target. Nevertheless, if we see the need to 
> define ac_cv_sizeof_int even though the value isn't currently different 
> anywhere, it seems at least consistent to set ac_cv_sizeof_pid_t there as 
> well.
> 
> However, I can't help feeling that these files are a bit of a mess and it's not 
> totally clear to me where I should be putting this value. Should it go in 
> common-linux? Or do I have to add it to the specific site file for every arch?

common-linux sounds like the right place to me.

Cheers,

Richard

Patch

diff --git a/meta/recipes-support/apr/apr_1.4.6.bb b/meta/recipes-support/apr/apr_1.4.6.bb
index 54c47fe..8af5411 100644
--- a/meta/recipes-support/apr/apr_1.4.6.bb
+++ b/meta/recipes-support/apr/apr_1.4.6.bb
@@ -9,7 +9,7 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=0c35ff3c4c83b89d2f076e315caac28b \
 
 BBCLASSEXTEND = "native"
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
            file://configure_fixes.patch \
@@ -23,6 +23,8 @@  inherit autotools lib_package binconfig multilib_header
 
 OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
 
+EXTRA_OECONF_append_class-target = " ac_cv_sizeof_pid_t=4"
+
 do_configure_prepend() {
 	cd ${S}
 	./buildconf