Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation problems on 32-bit systems #29

Closed
sehe opened this issue Jul 7, 2010 · 2 comments
Closed

Compilation problems on 32-bit systems #29

sehe opened this issue Jul 7, 2010 · 2 comments

Comments

@sehe
Copy link

sehe commented Jul 7, 2010

__divdi3 missing; propose to extend spl (optional reference: http://www.hackersdelight.org/HDcode/newCode/divDouble.c)

Compilation further required the following workarounds on my Lucid i386 box v2.6.35-rc3:

On your revision 8d2cb18:
0001-GCC-format-string-security-fixes.txt
0002-add_range-conflicts-with-new-kernel-symbol-since-v2.6..txt
0003-Size-of-format-parameter-is-arch-specific.txt

From f0639837324455f98457966ce94a34baba30a959 Mon Sep 17 00:00:00 2001
From: Seth Heeren 
Date: Wed, 7 Jul 2010 03:11:08 +0200
Subject: [PATCH 1/3] GCC format string security fixes

---
 cmd/zdb/zdb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index 7735434..788d0d1 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -1663,7 +1663,7 @@ dump_uberblock(uberblock_t *ub, const char *header, const char *footer)
 {
    time_t timestamp = ub->ub_timestamp;
 
-   (void) printf(header ? header : "");
+   (void) printf("%s", header ? header : "");
    (void) printf("\tmagic = %016llx\n", (u_longlong_t)ub->ub_magic);
    (void) printf("\tversion = %llu\n", (u_longlong_t)ub->ub_version);
    (void) printf("\ttxg = %llu\n", (u_longlong_t)ub->ub_txg);
@@ -1675,7 +1675,7 @@ dump_uberblock(uberblock_t *ub, const char *header, const char *footer)
        sprintf_blkptr(blkbuf, &ub->ub_rootbp);
        (void) printf("\trootbp = %s\n", blkbuf);
    }
-   (void) printf(footer ? footer : "");
+   (void) printf("%s", footer ? footer : "");
 }
 
 static void
-- 
1.7.0.4

From bdc1cf7401e2f06e9f6dc73f671a1f79725ac03c Mon Sep 17 00:00:00 2001
From: Seth Heeren 
Date: Wed, 7 Jul 2010 03:13:22 +0200
Subject: [PATCH 2/3] add_range conflicts with (new) kernel symbol since v2.6.33-rc7

---
 module/zfs/zfs_fm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c
index 5138f49..c85b234 100644
--- a/module/zfs/zfs_fm.c
+++ b/module/zfs/zfs_fm.c
@@ -465,7 +465,7 @@ shrink_ranges(zfs_ecksum_info_t *eip)
 }
 
 static void
-add_range(zfs_ecksum_info_t *eip, int start, int end)
+zadd_range(zfs_ecksum_info_t *eip, int start, int end)
 {
    struct zei_ranges *r = eip->zei_ranges;
    size_t count = eip->zei_range_count;
@@ -570,7 +570,7 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *info,
            if (start == -1)
                continue;
 
-           add_range(eip, start, idx);
+           zadd_range(eip, start, idx);
            start = -1;
        } else {
            if (start != -1)
@@ -580,7 +580,7 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *info,
        }
    }
    if (start != -1)
-       add_range(eip, start, idx);
+       zadd_range(eip, start, idx);
 
    /* See if it will fit in our inline buffers */
    inline_size = range_total_size(eip);
-- 
1.7.0.4

From ec93bb4528d5e382eedf1b67affb88ff486be858 Mon Sep 17 00:00:00 2001
From: Seth Heeren 
Date: Wed, 7 Jul 2010 03:18:55 +0200
Subject: [PATCH 3/3] Size of format parameter is arch specific

---
 module/zpios/zpios.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/module/zpios/zpios.c b/module/zpios/zpios.c
index 9aa3b5c..e289bab 100644
--- a/module/zpios/zpios.c
+++ b/module/zpios/zpios.c
@@ -1041,7 +1041,7 @@ zpios_ioctl_cmd(struct file *file, unsigned long arg)
 
    kcmd = kmem_alloc(sizeof(zpios_cmd_t), KM_SLEEP);
    if (kcmd == NULL) {
-       zpios_print(file, "Unable to kmem_alloc() %ld byte for "
+       zpios_print(file, "Unable to kmem_alloc() %Iu byte for " // FIXME test on 64bit as well
                "zpios_cmd_t\n", sizeof(zpios_cmd_t));
        return -ENOMEM;
    }
-- 
1.7.0.4
@behlendorf
Copy link
Contributor

Thanks for the proposed patches, I've fixed these issues in the latest git tree if you want to check it out and try it:

  • Explicitly cast sizeof() to avoid format warnings (599cbc06ae1faebad7a79999f10c8428986bd200)
    • Linux 2.6.34 compat: add_range() symbol collision (c8726eaf104a0feedb97149929b177b6625a1a8f)
    • Fix -Werror=format-security compiler option (01f9e8376789d4d8b821080d2890760cf559519f)

The __divdi3() issue turned out to be quite a bit more work than I expected but I've pulled in a fix in to the spl. Thanks for the Hacker's Delight reference that was handy. Much to my surprise when I added some 32-bit regression tests for this it exposed a flaw in the linux kernel 64-bit division implementation for 32-bit platforms. Anyway, the full fix was behlendorf/spl@a4bfd8e.

@sehe
Copy link
Author

sehe commented Jul 14, 2010

Much to my surprise when I added some 32-bit regression tests for this it exposed a flaw in the linux kernel 64-bit division implementation for 32-bit platforms

Woah! That is creepy :) Did you report it at lkml?

akatrevorjay added a commit to akatrevorjay/zfs that referenced this issue Dec 16, 2017
# This is the 1st commit message:
Merge branch 'master' of https://github.com/zfsonlinux/zfs

* 'master' of https://github.com/zfsonlinux/zfs:
  Enable QAT support in zfs-dkms RPM

# This is the commit message openzfs#2:

Import 0.6.5.7-0ubuntu3

# This is the commit message openzfs#3:

gbp changes

# This is the commit message openzfs#4:

Bump ver

# This is the commit message openzfs#5:

-j9 baby

# This is the commit message openzfs#6:

Up

# This is the commit message openzfs#7:

Yup

# This is the commit message openzfs#8:

Add new module

# This is the commit message openzfs#9:

Up

# This is the commit message openzfs#10:

Up

# This is the commit message openzfs#11:

Bump

# This is the commit message openzfs#12:

Grr

# This is the commit message openzfs#13:

Yay

# This is the commit message openzfs#14:

Yay

# This is the commit message openzfs#15:

Yay

# This is the commit message openzfs#16:

Yay

# This is the commit message openzfs#17:

Yay

# This is the commit message openzfs#18:

Yay

# This is the commit message openzfs#19:

yay

# This is the commit message openzfs#20:

yay

# This is the commit message openzfs#21:

yay

# This is the commit message openzfs#22:

Update ppa script

# This is the commit message openzfs#23:

Update gbp conf with br changes

# This is the commit message openzfs#24:

Update gbp conf with br changes

# This is the commit message openzfs#25:

Bump

# This is the commit message openzfs#26:

No pristine

# This is the commit message openzfs#27:

Bump

# This is the commit message openzfs#28:

Lol whoops

# This is the commit message openzfs#29:

Fix name

# This is the commit message openzfs#30:

Fix name

# This is the commit message openzfs#31:

rebase

# This is the commit message openzfs#32:

Bump

# This is the commit message openzfs#33:

Bump

# This is the commit message openzfs#34:

Bump

# This is the commit message openzfs#35:

Bump

# This is the commit message openzfs#36:

ntrim

# This is the commit message openzfs#37:

Bump

# This is the commit message openzfs#38:

9

# This is the commit message openzfs#39:

Bump

# This is the commit message openzfs#40:

Bump

# This is the commit message openzfs#41:

Bump

# This is the commit message openzfs#42:

Revert "9"

This reverts commit de488f1.

# This is the commit message openzfs#43:

Bump

# This is the commit message openzfs#44:

Account for zconfig.sh being removed

# This is the commit message openzfs#45:

Bump

# This is the commit message openzfs#46:

Add artful

# This is the commit message openzfs#47:

Add in zed.d and zpool.d scripts

# This is the commit message openzfs#48:

Bump

# This is the commit message openzfs#49:

Bump

# This is the commit message openzfs#50:

Bump

# This is the commit message openzfs#51:

Bump

# This is the commit message openzfs#52:

ugh

# This is the commit message openzfs#53:

fix zed upgrade

# This is the commit message openzfs#54:

Bump

# This is the commit message openzfs#55:

conf file zed.d

# This is the commit message #56:

Bump
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants