Bug 665703

Summary: plymouth fails building on powerpc
Product: [Fedora] Fedora Reporter: Adrian Reber <adrian>
Component: plymouthAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dennis, fedora, karsten, rstrode
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-28 10:57:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 121179    
Attachments:
Description Flags
patch tested on sparc none

Description Adrian Reber 2010-12-26 09:09:18 UTC
I am rebuilding rawhide on ppc and plymouth fails with:

DEBUG: /bin/sh ../../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I.
+-DPLYMOUTH_TIME_DIRECTORY=\"/var/lib/plymouth/\"          -Wall -Wno-sign-compare -Wno-deprecated-declarations
+-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -c -o
+libply_la-ply-utils.lo `test -f 'ply-utils.c' || echo './'`ply-utils.c
DEBUG: ply-utils.c: In function 'ply_get_process_command_line':
DEBUG: ply-utils.c:989:26: error: 'PAGE_SIZE' undeclared (first use in this function)
DEBUG: ply-utils.c:989:26: note: each undeclared identifier is reported only once for each function it appears in
DEBUG: ply-utils.c: In function 'ply_get_process_parent_pid':
DEBUG: ply-utils.c:1022:12: warning: ignoring return value of 'asprintf', declared with attribute
+warn_unused_result
DEBUG: ply-utils.c: In function 'ply_get_process_command_line':
DEBUG: ply-utils.c:979:12: warning: ignoring return value of 'asprintf', declared with attribute
+warn_unused_result
DEBUG: ply-utils.c: In function 'ply_list_directory':
DEBUG: ply-utils.c:684:16: warning: ignoring return value of 'asprintf', declared with attribute
+warn_unused_result
DEBUG: make[4]: Leaving directory `/builddir/build/BUILD/plymouth-0.8.4/src/libply'
DEBUG: make[4]: *** [libply_la-ply-utils.lo] Error 1
DEBUG: make[3]: *** [all-recursive] Error 1
DEBUG: make[3]: Leaving directory `/builddir/build/BUILD/plymouth-0.8.4/src/libply'
DEBUG: make[2]: Leaving directory `/builddir/build/BUILD/plymouth-0.8.4/src'
DEBUG: make[2]: *** [all-recursive] Error 1
DEBUG: make[1]: Leaving directory `/builddir/build/BUILD/plymouth-0.8.4'
DEBUG: make[1]: *** [all-recursive] Error 1
DEBUG: make: *** [all] Error 2
DEBUG: RPM build errors:
DEBUG: error: Bad exit status from /var/tmp/rpm-tmp.bWqbtm (%build)

PAGE_SIZE is not exported and should not be used; see getpagesize(2). Following patch fixes building plymouth on ppc:

# cat ~adrian/rpmbuild/SOURCES/plymouth-getpagesize.patch
--- a/src/libply/ply-utils.c.org 2010-12-26 00:12:06.000000000 +0100
+++ b/src/libply/ply-utils.c    2010-12-26 00:13:18.000000000 +0100
@@ -46,7 +46,7 @@
 #include <time.h>
 #include <linux/fs.h>
 #include <linux/vt.h>
-
+#include <unistd.h>
 #include <dlfcn.h>

 #include "ply-logger.h"
@@ -971,6 +971,7 @@
   char *command_line;
   ssize_t bytes_read;
   int fd;
+  long ps;
   ssize_t i;

   path = NULL;
@@ -986,8 +987,9 @@
       goto error;
     }

-  command_line = calloc (PAGE_SIZE, sizeof (char));
-  bytes_read = read (fd, command_line, PAGE_SIZE - 1);
+  ps = sysconf(_SC_PAGESIZE);
+  command_line = calloc (ps, sizeof (char));
+  bytes_read = read (fd, command_line, ps - 1);
   if (bytes_read < 0)
     {
       ply_trace ("Could not read %s: %m", path);

Comment 1 Adrian Reber 2011-01-27 12:54:19 UTC
Can this patch please be applied? I can commit it myself if it is okay with you.

http://ppc.koji.fedoraproject.org/koji/buildinfo?buildID=26584

Comment 2 Dennis Gilmore 2011-02-28 04:58:14 UTC
build fails the same on sparc  see 
http://sparc.koji.fedoraproject.org/koji/taskinfo?taskID=81547

Comment 3 Dennis Gilmore 2011-02-28 06:51:09 UTC
Created attachment 481315 [details]
patch tested on sparc

i have build tested this patch on sparc

Comment 4 Karsten Hopp 2011-10-28 10:57:19 UTC
latest plymouth builds fine on ppc, and there's a plymouth-0.8.4-0.1.20110304.1.fc16 on sparc which seems to have a fix for this. Closing