The source tar.gz file which contains the spec file inside, build successfully on RH 7.3 using rpm 4.0.4. On gentoo 1.4-r2 it's work fine before creating the rpm file. (prepare, build, install complete successfully) But give "Fseek failed: Invalid argument" when start write the rpm file. The output from gentoo: Finding Provides: (using /usr/lib/rpm/find-provides)... Finding Requires: (using /usr/lib/rpm/find-requires)... Provides: libwrapper.so PreReq: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 Requires(rpmlib): rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib (CompressedFileNames) <= 3.0.4-1 Requires: ld-linux.so.2 libc.so.6 /bin/bash /bin/sh libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.3) error: /var/tmp/rpm-tmp.26337: Fseek failed: Invalid argument The output from RH 7.3 Finding Provides: (using /usr/lib/rpm/find-provides)... Finding Requires: (using /usr/lib/rpm/find-requires)... /var/tmp/alert_svr/home/qpalert/alert_svr/bin/realpath: /lib/i686/libc.so.6: version `GLIBC_2.3' not found (required by /var/tmp/alert_svr/home/qpalert/alert_svr/bin/realpath) Provides: libwrapper.so PreReq: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 Requires(rpmlib): rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib (CompressedFileNames) <= 3.0.4-1 Requires: ld-linux.so.2 libc.so.6 /bin/bash /bin/sh libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.3) Wrote: /usr/src/redhat/SRPMS/alert_svr-1.0-1.src.rpm Wrote: /usr/src/redhat/RPMS/i386/alert_svr-1.0-1.i386.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.59940 + umask 022 + cd /usr/src/redhat/BUILD + cd alert_svr + rm -rf /var/tmp/alert_svr + exit 0
Created attachment 8467 [details, diff] patch the fdSeek function for glibc 2.3 This is a simple patch which fixed the "Invalid argument" problem when using glibc 2.3 Note: if your glibc <= 2.2 DONOT use this patch. (reason of the bug: glibc >=2.2 change the expected seeker interface of customized stream / cookied stream, passing the (pos_t*) rather then (pos_t). the rpm-4.0.4 take care the glibc 2.2 only.
This should really be in portage. It would have saved me an hour.
Err, that patch you sent is wrong, and not the real problem, to see the real fix see line 25 in rpmio/rpmio.h in the rpm source. The #if statemant is wrong, it should have also included glibc 2.3.2 in it's check. If it did then USE_COOKIE_SEEK_POINTER would be defined, and alternative code would be used. do you agree? I have not tested it yet though.
Created attachment 8811 [details, diff] rpm-4.0.4-glibc2.3.diff This is my version which I added to portage a while ago in rpm-4.0.4-r5.ebuild, please test, if it works I will unmask it.
your are right for that my patch did not suitable for glibc <2.2. or system use library other than glibc. however the reason of the problem I state is not wrong, that's why rpm need to define USE_COOKIE_SEEK_POINTER. I did not modify the header file is because I am not sure that the _IO_off64_t is correct or not for gentoo system. __USE_FILE_OFFSET64 should be defined in order to use _IO_off64_t. and the fact is start from glibc 2.2 it's pass pointer to cookied seeker function, No matter __USE_FILE_OFFSET64 is defined or not.
My patch fixes this issue, but rpm is not 100% working here. I will see if I can get 4.1.x working, closing bug and marking the new revision as stable. Stefan
see above