LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-19-2011, 05:45 AM   #1
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Rep: Reputation: 1
undefined reference to `gzdFdopen'


Hi

When I try to build rpm-4.8.1 on RHEL6 i686, some errors after `make`:
Code:
libtool: link: gcc -std=gnu99 -g -O2 -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts -fno-strict-aliasing -fstack-protector -Wempty-body -o .libs/rpmdb_archive ../db3/db_archive.o ../db3/util_sig.o  ./.libs/librpm.so /root/rpm-4.8.1/rpmio/.libs/librpmio.so -lnss3 -llua -lm -lpopt -lrt -lpthread -Wl,-rpath -Wl,/usr/local/lib
/root/rpm-4.8.1/rpmio/.libs/librpmio.so: undefined reference to `gzdFdopen'
collect2: ld returned 1 exit status
make[3]: *** [rpmdb_archive] Error 1
make[3]: Leaving directory `/root/rpm-4.8.1/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/rpm-4.8.1/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpm-4.8.1'
make: *** [all] Error 2
What package should I need to install? I searched a lot and found someone said it needed gzip and/or gzip-devel. My system already has gzip installed. But I can't find where to get gzip-devel. Is this true? I need to install gzip-devel to make?

THANKS!
 
Old 04-19-2011, 08:25 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.6 + 50+ other Linux OS, for test only.
Posts: 17,218

Rep: Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554
Why would you replace the perfectly working rpm-4.8.0 ? ?

Prerequisites: # yum install db4-devel fakechroot redhat-rpm-config \
elfutils-devel elfutils-libelf-devel readline-devel zlib-devel \
nss-devel popt-devel file-devel gettext-devel libselinux-devel \
ncurses-devel bzip2-devel python-devel lua-devel libcap-devel \
libacl-devel xz-devel

When you are using "rpm-4.8.1.tar.bz2", the 15 patches are missing?

rpmbuild -bb rpm.spec : No errors.
( Or rpmbuild --rebuild rpm-4.8.1-5.fc14.src.rpm )
http://download.fedora.redhat.com/pu...5.fc14.src.rpm

..
 
Old 04-20-2011, 01:35 AM   #3
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Original Poster
Rep: Reputation: 1
Because I encountered an issue when using rpm-4.8.0
http://www.linuxquestions.org/questi...ectory-875129/
 
Old 04-20-2011, 09:24 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.6 + 50+ other Linux OS, for test only.
Posts: 17,218

Rep: Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554
OK, I have seen that too. Rpm-4.8 works OK, AFAIK.

Suggest : Set up the recommended unprivileged rpmbuild account in /home/<user>
http://www.linuxquestions.org/questi...1-a-766486/#13
( post # 13 ).

And then try using your rpm-4.8 again.


Also : As you can see from post # 2, I had no problems when I was
building rpm-4.8.1. And I used rpm-4.8.0 to build 4.8.1 !

..

Last edited by knudfl; 04-20-2011 at 09:41 AM.
 
Old 04-20-2011, 10:33 PM   #5
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Original Poster
Rep: Reputation: 1
Hi knudfl,

YES! rpmbuild can succeed after I did what you told me. But the truth is I can build the package without any problem as root on earlier distributions, like RHEL5, Fedora13. I don't have to create those directories and the ~/.rpmmacros file. Why I need to do those stuff on RHEL6 with RPM 4.8.1? Is there any specific changes about this?

THANKS!

Last edited by password636; 04-21-2011 at 02:31 AM.
 
Old 04-21-2011, 12:10 AM   #6
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Original Poster
Rep: Reputation: 1
This post is identical to above because OP posted it in 2 places, here & http://www.linuxquestions.org/questi...t-5-1-a-766486. This is against
LQ Rules.

It got 1 answer here & 4 answers there. I have merged the conversation by moving the 5 new posts in http://www.linuxquestions.org/questi...t-5-1-a-766486 (the last previous post was in Nov., 2009) here. Because knudfl's post #11 was in answer to this post, w/o seeing the 4 that now follow, it may seem out of context. -- My apologies, AFAIK that's the way forum s/w works.



Hi knudfl,

YES! rpmbuild can succeed after I did what you told me. But the truth is I can build the package without any problem as root on earlier distributions, like RHEL5, Fedora13. I don't have to create those directories and the ~/.rpmmacros file. Why I need to do those stuff on RHEL6 with RPM 4.8.1? Is there any specific changes about this?

THANKS!


password636,
Please re-read the LQ Rules & don't double post again. Also, please do not edit this explantion.

Thank you for your co-operation.

Last edited by archtoad6; 05-05-2011 at 11:46 AM. Reason: explain moved posts
 
Old 04-21-2011, 12:17 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,406
Blog Entries: 55

Rep: Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578
Quote:
Originally Posted by password636 View Post
the truth is I can build the package without any problem as root on earlier distributions, like RHEL5, Fedora13. I don't have to create those directories and the ~/.rpmmacros file. Why I need to do those stuff on RHEL6 with RPM 4.8.0? Is there any specific changes about this?
The fact you could do that does not make it right: no change except human behaviour. Compiling software, creating packages should be done as unprivileged user by default so you don't unintentionally b0rk the system or allow any malicious activity to undermine system integrity. Only the actual installation of the final package should be done as root user.
 
Old 04-21-2011, 02:25 AM   #8
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Original Poster
Rep: Reputation: 1
Hi unSpawn,

I can succeed with rpm 4.8.1, but not with rpm 4.8.0. So I still think there is something wrong with 4.8.0.

Here is the situation:
knudfl's config + rpmbuild 4.8.1 + unprivileged user => OK
knudfl's config + rpmbuild 4.8.0 + unprivileged user => NG

In the second situation, rpmbuild still deletes the directory, below is the temp file
Quote:
#!/bin/sh

RPM_SOURCE_DIR="/tmp/test/testrpm/SOURCES"
RPM_BUILD_DIR="/tmp/test/testrpm/BUILD"
RPM_OPT_FLAGS="-O2"
RPM_ARCH="noarch"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
RPM_DOC_DIR="/usr/share/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="testrpm"
RPM_PACKAGE_VERSION="1.0.0"
RPM_PACKAGE_RELEASE="1"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT="/tmp/test/testrpm"
export RPM_BUILD_ROOT

PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig"
export PKG_CONFIG_PATH

set -x
umask 022
cd "/tmp/test/testrpm/BUILD"
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"
mkdir -p `dirname "$RPM_BUILD_ROOT"`
mkdir "$RPM_BUILD_ROOT"

LANG=C
export LANG
unset DISPLAY




/usr/lib/rpm/check-buildroot
/usr/lib/rpm/brp-compress
 
Old 04-21-2011, 03:47 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.6 + 50+ other Linux OS, for test only.
Posts: 17,218

Rep: Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554
# 14, @password636 :

Isn't it somehow confusing, that you use three threads for the rpm(-4.8) issues ?

The other threads are
http://www.linuxquestions.org/questi...5/#post4330189

http://www.linuxquestions.org/questi...ectory-875129/
 
Old 04-21-2011, 09:25 PM   #10
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by knudfl View Post
# 14, @password636 :

Isn't it somehow confusing, that you use three threads for the rpm(-4.8) issues ?

The other threads are
http://www.linuxquestions.org/questi...5/#post4330189

http://www.linuxquestions.org/questi...ectory-875129/
I'm sorry about this. I actually have two topics, one is about the unexpected directory deletion about rpm 4.8.0(the 2rd thread) and the other is the issue I encountered when trying to build rpm 4.8.1 (the 1st thread). I wanted to solve my problem with rpm 4.8.0, but I found that there seemed something wrong with it, so I also tried rpm 4.8.1. About this thread, it's my mistake, I post the wrong page when I read this thread, but I didn't find the way to delete it. The Edit button says about Eidt/Delete, but I could not delete the reply. I also post the same in the first thread trying to correct things. Then unSpawn followed a reply here, and I continued till now. But I want to THANK unSpawn for following. It was my wrong post at first. Is there any way that I can move the posts in this thread to the first thread above?
 
Old 04-22-2011, 08:55 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.6 + 50+ other Linux OS, for test only.
Posts: 17,218

Rep: Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554Reputation: 3554
Quote:
Why I need to do those stuff on RHEL6 with RPM 4.8.1 ?
You will always need the rpm account in /home/<user>/.


There is a difference :
The file .rpmmacros is simpler than the default functions.
Which I of course never use, as the /home/<user>/ location
is the recommended one. See post # 15 here :
http://www.linuxquestions.org/questi...-5-1-a-766486/

The account in /home/<user>/ is also much easier to use.
All commands and edits can be done as ordinary user.
Conclusion : Only that one should be used.

..
 
Old 05-05-2011, 11:00 AM   #12
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
5 posts have been moved from here:
http://www.linuxquestions.org/questi...-5-1-a-766486/, see the explanation above.
knudfl's post #11 immediately prior to this one was originally #6, & may seem out of context.


[COLOR="DarkRed"]This post is identical to above because OP posted it in 2 places, here & [url]http://www.linuxquestions.org/questions/linux-software-2/need-rpm-package-for-php-version-5-2-7-and-up-on-redhat-5-1-a-766486[/url]. This is against
[URL="http://www.linuxquestions.org/linux/rules.html"]LQ Rules[/URL].

It got 1 answer here & 4 answers there. I have merged the conversation by moving the 5 new posts in [url]http://www.linuxquestions.org/questions/linux-software-2/need-rpm-package-for-php-version-5-2-7-and-up-on-redhat-5-1-a-766486[/url] (the last previous post was in Nov., 2009) here. Because [I]knudfl[/I]'s [URL="http://www.linuxquestions.org/questions/linux-software-2/undefined-reference-to-%60gzdfdopen-875845/#post4332626"]post #11[/URL] was in answer to this post, w/o seeing the 4 that now follow, it may seem out of context. -- My apologies, AFAIK that's the way forum s/w works.[/COLOR]


[COLOR="DimGray"]Hi knudfl,

YES! rpmbuild can succeed after I did what you told me. But the truth is I can build the package without any problem as root on earlier distributions, like RHEL5, Fedora13. I don't have to create those directories and the ~/.rpmmacros file. Why I need to do those stuff on RHEL6 with RPM 4.8.1? Is there any specific changes about this?

THANKS![/COLOR]

[I]password636[/I],
Please re-read the [URL="http://www.linuxquestions.org/linux/rules.html"]LQ Rules[/URL] & don't double post again. Also, please do not edit this explantion.

Thank you for your co-operation.

Last edited by archtoad6; 05-05-2011 at 11:45 AM.
 
Old 05-05-2011, 12:25 PM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,406
Blog Entries: 55

Rep: Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578
Quote:
Originally Posted by password636 View Post
In the second situation, rpmbuild still deletes the directory, below is the temp file
I think there's a problem with your definition of $RPM_BUILD_DIR, %{_topdir}/BUILD: the directory in which the package tarball directory will be expanded to be build, and $RPM_BUILD_ROOT, the directory in which the package %{name}-%{version}-%{release} directory will be created for installation. $RPM_BUILD_ROOT can be a subdirectory like %{_topdir}/tmp, or you may chose a completely different path in your .spec file like "BuildRoot: /tmp/%{name}-%{version}", but it should not equal %{_topdir}. I think you best first change your RPM directory structure and reflect changes in the .spec file before continuing. See: http://www.ibm.com/developerworks/li...pm1/index.html and http://docs.fedoraproject.org/drafts...-en/index.html (start at Chapter 8 "Creating RPMs: An Overview").
 
Old 09-21-2011, 06:20 AM   #14
danmihai
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by password636 View Post
Hi

When I try to build rpm-4.8.1 on RHEL6 i686, some errors after `make`:
Code:
libtool: link: gcc -std=gnu99 -g -O2 -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts -fno-strict-aliasing -fstack-protector -Wempty-body -o .libs/rpmdb_archive ../db3/db_archive.o ../db3/util_sig.o  ./.libs/librpm.so /root/rpm-4.8.1/rpmio/.libs/librpmio.so -lnss3 -llua -lm -lpopt -lrt -lpthread -Wl,-rpath -Wl,/usr/local/lib
/root/rpm-4.8.1/rpmio/.libs/librpmio.so: undefined reference to `gzdFdopen'
collect2: ld returned 1 exit status
make[3]: *** [rpmdb_archive] Error 1
make[3]: Leaving directory `/root/rpm-4.8.1/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/rpm-4.8.1/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpm-4.8.1'
make: *** [all] Error 2
What package should I need to install? I searched a lot and found someone said it needed gzip and/or gzip-devel. My system already has gzip installed. But I can't find where to get gzip-devel. Is this true? I need to install gzip-devel to make?

THANKS!

I got passed that error by installing zlib-devel package
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Yet another undefined reference CollieJim Linux - General 2 12-17-2010 11:08 PM
undefined reference to.... crapodino Programming 1 01-13-2008 07:05 PM
undefined reference to... dimah Programming 3 12-27-2006 09:57 AM
Undefined reference to: ashlesha Programming 5 11-08-2006 01:07 PM
undefined reference vkmgeek Programming 1 05-11-2006 06:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration