Skip to contentSkip to conversation

libzypp: Fix buiild with gcc 4.7

PATCH Applied Khem Raj 2 participants 2 messages Mar 23, 2012 – Apr 3, 2012

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 libzypp: Fix buiild with gcc 4.7

it needs protype of close() before using it

---
 meta/recipes-extended/libzypp/libzypp/close.patch |   32 +++++++++++++++++++++
 meta/recipes-extended/libzypp/libzypp_git.bb      |    3 +-
 2 files changed, 34 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-extended/libzypp/libzypp/close.patch
meta/recipes-extended/libzypp/libzypp/close.patch new file +32 -0
new file mode 100644
index 0000000..0ff1825
@@ -0,0 +1,32 @@
+close() is used without a protype therefore we include unistd.h
+Fixes compile errors like below
+
+/home/kraj/work/openembedded-core/build/tmp-eglibc/work/qemuppc-oe-linux/libzypp-0.0-git1+15b6c52260bbc52b3d8e585e271b67e10cc7c433-r18/git/zypp/ExternalProgram.h:239:47: error: '::close' has not been declared
+
+Signed-off-by: Khem Raj <[email protected]>
+
+Upstream-Status: Pending
+Index: git/zypp/ExternalProgram.h
+===================================================================
+--- git.orig/zypp/ExternalProgram.h	2012-03-23 08:27:31.716438539 -0700
++++ git/zypp/ExternalProgram.h	2012-03-23 08:27:54.520439367 -0700
+@@ -16,6 +16,7 @@
+ #include <map>
+ #include <string>
+ #include <vector>
++#include <unistd.h>
+ 
+ #include "zypp/base/ExternalDataSource.h"
+ #include "zypp/Pathname.h"
+Index: git/zypp/base/Random.cc
+===================================================================
+--- git.orig/zypp/base/Random.cc	2012-03-23 08:31:09.732449118 -0700
++++ git/zypp/base/Random.cc	2012-03-23 08:31:36.240450324 -0700
+@@ -3,6 +3,7 @@
+ #include <cstdio>
+ #include <iostream>
+ #include <fcntl.h>
++#include <unistd.h>
+ #include "zypp/base/Random.h"
+ 
+ using namespace std;
meta/recipes-extended/libzypp/libzypp_git.bb +2 -1
index 368cc06..78c7a6a 100644
@@ -11,7 +11,7 @@ DEPENDS  = "rpm boost curl libxml2 zlib sat-solver expat openssl udev"
 S = "${WORKDIR}/git"
 SRCREV = "15b6c52260bbc52b3d8e585e271b67e10cc7c433"
 PV = "0.0-git${SRCPV}"
-PR = "r18"
+PR = "r19"
 
 SRC_URI = "git://github.com/openSUSE/libzypp.git;protocol=git \
            file://no-doc.patch \
@@ -22,6 +22,7 @@ SRC_URI = "git://github.com/openSUSE/libzypp.git;protocol=git \
 	   file://libzypp-compatargs.patch \
 	   file://fix_for_compile_wth_gcc-4.6.0.patch \
 	   file://hardcode-lib-fix.patch \
+	   file://close.patch \
           "
 
 SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch"
Signature · 1 line
1.7.5.4
Applied
#1 lore raw
Quoted 61 lines · Khem Raj

it needs protype of close() before using it

---
  meta/recipes-extended/libzypp/libzypp/close.patch |   32 +++++++++++++++++++++
  meta/recipes-extended/libzypp/libzypp_git.bb      |    3 +-
  2 files changed, 34 insertions(+), 1 deletions(-)

create mode 100644 meta/recipes-extended/libzypp/libzypp/close.patch

meta/recipes-extended/libzypp/libzypp/close.patch new file +32 -0
new file mode 100644
index 0000000..0ff1825
@@ -0,0 +1,32 @@
+close() is used without a protype therefore we include unistd.h
+Fixes compile errors like below
+
+/home/kraj/work/openembedded-core/build/tmp-eglibc/work/qemuppc-oe-linux/libzypp-0.0-git1+15b6c52260bbc52b3d8e585e271b67e10cc7c433-r18/git/zypp/ExternalProgram.h:239:47: error: '::close' has not been declared
+
+Signed-off-by: Khem Raj<[email protected]>
+
+Upstream-Status: Pending
+Index: git/zypp/ExternalProgram.h
+===================================================================
+--- git.orig/zypp/ExternalProgram.h	2012-03-23 08:27:31.716438539 -0700
++++ git/zypp/ExternalProgram.h	2012-03-23 08:27:54.520439367 -0700
+@@ -16,6 +16,7 @@
+ #include<map>
+ #include<string>
+ #include<vector>
++#include<unistd.h>
+
+ #include "zypp/base/ExternalDataSource.h"
+ #include "zypp/Pathname.h"
+Index: git/zypp/base/Random.cc
+===================================================================
+--- git.orig/zypp/base/Random.cc	2012-03-23 08:31:09.732449118 -0700
++++ git/zypp/base/Random.cc	2012-03-23 08:31:36.240450324 -0700
+@@ -3,6 +3,7 @@
+ #include<cstdio>
+ #include<iostream>
+ #include<fcntl.h>
++#include<unistd.h>
+ #include "zypp/base/Random.h"
+
+ using namespace std;
meta/recipes-extended/libzypp/libzypp_git.bb +1 -1
index 368cc06..78c7a6a 100644
@@ -11,7 +11,7 @@ DEPENDS  = "rpm boost curl libxml2 zlib sat-solver expat openssl udev"
  S = "${WORKDIR}/git"
  SRCREV = "15b6c52260bbc52b3d8e585e271b67e10cc7c433"
  PV = "0.0-git${SRCPV}"
-PR = "r18"
+PR = "r19"
 
  SRC_URI = "git://github.com/openSUSE/libzypp.git;protocol=git \
             file://no-doc.patch \

meta/recipes-extended/libzypp/libzypp_git.bb SRC_URI = "git://github.com/openSUSE/libzypp.git;protocol=git \ · line 28

Quoted 7 lines
meta/recipes-extended/libzypp/libzypp_git.bb +1 -0
@@ -22,6 +22,7 @@ SRC_URI = "git://github.com/openSUSE/libzypp.git;protocol=git \
  	   file://libzypp-compatargs.patch \
  	   file://fix_for_compile_wth_gcc-4.6.0.patch \
  	   file://hardcode-lib-fix.patch \
+	   file://close.patch \
            "
 
  SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch"

Merged into OE-Core

Thanks
Sau!