Home | Docs | Forums | Lists | Bugs | Planet | Store | GMN | Get Gentoo!
View Bug Activity | Format For Printing | XML | Clone This Bug
Attached you will find my first go at a contributed ebuild. I patched the vanilla cloop_2.01-4 so that it would compile against my amd64 running 2.6.7-ck5. Reproducible: Always Steps to Reproduce: 1. ACCEPT_KEYWORDS="~amd64" emerge cloop 2. modprobe cloop file=/tmp/KNOPPIX 3. mount -t iso9660 /dev/cloop/0 /mnt/cdrom Actual Results: I was able to see my custom KNOPPIX compressed disk perfectly. Expected Results: It should have failed to compile as the other cloop ebuilds don't support Linux 2.6 nor amd64. The resulting module taints the kernel as there isn't a 'struct_module' in the versions[] array. I didn't want to add a patch that would create it, as I feel this module is very unstable, and it should remain tainted until someone with more kernel knowledge looks at the code. At one point, I couldn't see any cloop devices, and I had to reboot before I could see the cloop devices. I am not certain if it's related to the module, or other dealings that had been done on the machine that day.
Created an attachment (id=35926) [edit] my ebuild that works with amd64 and linux 2.6
Created an attachment (id=35927) [edit] a patch that addes 2.6 support and compiler flags for amd64
it's up to base-system to decide if this can be used. As soon as it's in, i'll test it on amd64.
bugs 69071 and 69072 are duplicates. Latest is -5 The latest version does not build for me: cc -I/usr/src/linux/include -I/usr/src/linux/include/asm/mach-default -march=i586 -fomit-frame-pointer -pipe -Os -D__KERNEL__ -DMODULE -fno-builtin -nostdlib -DKBUILD_MODNAME="cloop" -DKBUILD_BASENAME="cloop" -D__OPTIMIZE__ compressed_loop.c -c -o compressed_loop.o compressed_loop.c: In function `clo_read_actor': compressed_loop.c:205: error: structure has no member named `buf' compressed_loop.c: In function `clo_read_from_file': compressed_loop.c:231: error: structure has no member named `buf' make: *** [compressed_loop.o] Error 1 We obviously need another patch ;) The ebuild is a hell of a mess: inheritting twice, kernel-mod_get_version in global context. checks should e done in pkg_setup using the new methods provided by kernel-mod.eclass
*** Bug 69072 has been marked as a duplicate of this bug. ***
*** Bug 69071 has been marked as a duplicate of this bug. ***
Created an attachment (id=44472) [edit] new ebuild that fixes compile errors 2.6.8 introduced changes in linux/fs.h. It added an arg union to read_descriptor_t. Into that union was defined *buf and a new pointer *data. Thus, old code that referenced ->buf needed to be changed to reference ->arg.buf.
Created an attachment (id=44473) [edit] patch for 2.6.8 and up based systems that fixes code that relies on linux/fs.h
Created an attachment (id=44475) [edit] cloop-2.01-r5.ebuild for the new cloop this ebuild also fixes some ugly displays in the emerge. mainly in the way kernel-mod_is_2_6_kernel and kernel-mod_is_2_4_kernel from kernel-mod.eclass call kernel-mod_getversion each time.
Created an attachment (id=44486) [edit] cloop-2.01.5.ebuild Cleaned-up ebuild base-system: Can I take this bug?
Created an attachment (id=44487) [edit] cloop.amd64.patch Additional patch for amd64. amd64: Can you please verify if this patch is really needed?
Created an attachment (id=44494) [edit] ebuild based on 2.01.5 with new patch this ebuild just adds an epatch line to add cloop.zlib-amd64.patch to the source
Created an attachment (id=44495) [edit] cloop.zlib-amd64.patch this patches create_compressed_fs to handle 64-bit integers. zlib on amd64 already handles it, but the source in the cloop module assumes certain things about bit-ness.
cloop.amd64.patch: I didn't notice anything detrimental by not having this patch. The patch looks more about fixing C++ syntax than anything else.
ok, I talked to vapier, it is my pkg now :)
make[1]: Entering directory `/var/tmp/portage/cloop-2.01.5/work/cloop-2.01/advancecomp-1.9_create_compressed_fs' g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O3 -DUSE_ERROR_SILENT -DUSE_COMPRESS -c -o advfs.o `test -f 'advfs.cc' || echo './'`advfs.cc cc -I/usr/src/linux/include -I/usr/src/linux/include/asm/mach-default -march=i586 -fomit-frame-pointer -pipe -Os -D__KERNEL__ -DMODULE -fno-builtin -nostdlib -DKBUILD_MODNAME="cloop" -DKBUILD_BASENAME="cloop" -D__OPTIMIZE__ compressed_loop.c -c -o compressed_loop.o advfs.cc:33:1: warning: "__OPTIMIZE__" redefined <built-in>:64:1: warning: this is the location of the previous definition advfs.cc: In function `cb_list* create_compressed_blocks(int, long unsigned int, long unsigned int*, int)': advfs.cc:114: error: invalid initialization of non-const reference of type 'unsigned int&' from a temporary of type 'unsigned int' compress.h:60: error: in passing argument 3 of `bool compress_zlib(shrink_t, unsigned char*, unsigned int&, const unsigned char*, unsigned int)' cc -o extract_compressed_fs extract_compressed_fs.o -lz make[1]: *** [advfs.o] Error 1 make[1]: Leaving directory `/var/tmp/portage/cloop-2.01.5/work/cloop-2.01/advancecomp-1.9_create_compressed_fs' make: *** [advancecomp-1.9_create_compressed_fs/advfs] Error 2 make: *** Waiting for unfinished jobs.... Compile error with your last patch
I'm thinking that's a gcc type casting issue. gcc probably has changed the way it type casts between certain versions. The reason I believe that is I can't get that particular object file advfs.o to fail on any of my gentoo boxes: amd64 2.6.9-ck3 (also tried in chroot) i686 2.6.8-gentoo-r2 i686 2.6.9-ck1 In addition, I tried the patched source on a SUSE 9 box: i686 2.4.18 on all the Gentoo machines, I'm running gcc 3.3.4 on the SUSE box I'm running gcc 2.95.3 I'm going to patch the ebuild and add a "use amd64" before that last patch. It should fix the problem and allow it to compile. However, the cloop package itself needs some serious patching as the author enjoys type casting. I would like to figure out the issue with the patch installed, however, without more information I'm unable to reproduce the failure.
Created an attachment (id=44606) [edit] cloop-2.01.5.ebuild with use amd64 I'd like to keep the old ebuild, once I figure out the bug in the cloop.zlib-amd64.patch, I'll obsolete this one.
I tested with gcc-3.4.3 here, I committed the ebuild without your zlib patch for now, because gcc-3.4 is something that we currently have on many gentoo machines and I do not know if it fails for amd64 with gcc 3.4.
Created an attachment (id=44608) [edit] cloop.zlib-amd64.patch gcc 3.4 must have become more strict in the way it handles C++ type casting. [advancecomp-1.9_create_compressed_fs/compress.h] defines compress_zlib() with : unsigned& out_size This worked fine in older gcc versions, but 3.4 tries to type cast it out as if it was called like so: compress_zlib(level, out_data, &out_size, in_data, in_size); instead of without the '&' as is in the source: compress_zlib(level, out_data, out_size, in_data, in_size); so, I added an interm variable to make 3.4 happy since the type casting happens before it's c++ casting takes place. Test on 3.4 and let me know if that fixes your compile error. This patch is critical for the create_compressed_fs command to work on amd64. Otherwise it segfaults.
thanks, I added your corrected patch. Is this still needed for amd64 with your latest patch? I would like to get everything for advfs in one patch to send it upstream. diff -ru cloop-2.01/advancecomp-1.9_create_compressed_fs/advfs.cc cloop-2.01.new/advancecomp-1.9_create_compressed_fs/advfs.cc --- cloop-2.01/advancecomp-1.9_create_compressed_fs/advfs.cc 2004-04-18 15:33:29.000000000 -0500 +++ cloop-2.01.new/advancecomp-1.9_create_compressed_fs/advfs.cc 2004-07-20 11:55:28.000000000 -0500 @@ -30,6 +30,7 @@ #include "utility.h" #include "compress.h" #include "siglock.h" +#define __OPTIMIZE__ #include <netinet/in.h> #include "lib/mng.h" PLease also look at how debian shipps the pkg: (Only the last two diffs are important) http://http.us.debian.org/debian/pool/main/c/cloop/cloop_2.01.5-1.diff.gz I think it is better to do it in the same way as debian for the 2.6 kernel compatibility.
Created an attachment (id=44643) [edit] cloop-2.01.5.ebuild - new patches + make clean - merged the debian patch (last two diffs) - added a make clean to the ebuild, because the package tarball has a Makefile that was created via ./configure from the author's development box. - moved the __OPTIMIZE__ patch in advfs.cc into the parent Makefile - it's purpose is to fix 2.6 systems with broken headers or with 2.4 headers.
Created an attachment (id=44645) [edit] cloop.cplusplus-syntax-fix.patch - I wanted to give the patch a better name than cloop.amd64.patch - this patch corrects some c++ syntax that gcc 3.4 might complain about
Created an attachment (id=44646) [edit] cloop.kern26.patch - merged patch from debian and obsoleted patch. - fixes code that relies on linux/fs.h - addes amd64 kernel flags to Makefile - checks for 2.6 kernel
Created an attachment (id=44648) [edit] cloop.zlib-amd64.patch (cleaned) old cloop.zlib-amd64.patch is now off by one line. It will still patch, but this one will patch without warnings.