[patch] Re: 2.6.8-rc2-mm1: NTFS compile error with gcc 2.95

From: Adrian Bunk (bunk_at_fs.tum.de)
Date: 07/29/04

  • Next message: Maneesh Soni: "[PATCH 4/5] Change sysfs_file_operations"
    Date:	Thu, 29 Jul 2004 22:42:50 +0200
    To: Andrew Morton <akpm@osdl.org>, aia21@cantab.net, linux-kernel@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net
    
    

    On Thu, Jul 29, 2004 at 05:54:11PM +0200, Jan-Benedict Glaw wrote:
    > >
    > > This causes the following compile error when using gcc 2.95:
    > >
    > > <-- snip -->
    > >
    > > ...
    > > LD .tmp_vmlinux1
    > > fs/built-in.o(.text+0x14425f): In function `ntfs_find_vcn':
    > > : undefined reference to `__cmpdi2'
    > > fs/built-in.o(.text+0x144272): In function `ntfs_find_vcn':
    > > : undefined reference to `__cmpdi2'
    > > make: *** [.tmp_vmlinux1] Error 1
    > >
    > > <-- snip -->
    >
    > GCC wanted to make a compare on a 8byte integer (so probably long long),
    > but decided there isn't an appropriate insn on that hardware platform.
    > So instead of emitting assembler, it generated a function call that
    > would have resulted in a call to libgcc. However, the Linux kernel asks
    > to *not* link that lib (eg. think about a gcc compiled for i686 (so is
    > libgcc) while compiling for i386).
    >...

    We had the same problem somewhere else recently.

    This problem occurs only with gcc 2.95 and case statements.

    > MfG, JBG

    What about the following patch to fix NTFS compilation with gcc 2.95?

    Signed-off-by: Adrian Bunk <bunk@fs.tum.de>

    --- linux-2.6.8-rc2-mm1-full/fs/ntfs/attrib.c.old 2004-07-29 22:34:21.000000000 +0200
    +++ linux-2.6.8-rc2-mm1-full/fs/ntfs/attrib.c 2004-07-29 22:36:15.000000000 +0200
    @@ -1113,15 +1113,11 @@
                             }
                             rl++;
                     }
    - switch (rl->lcn) {
    - case (LCN)LCN_RL_NOT_MAPPED:
    - break;
    - case (LCN)LCN_ENOENT:
    - err = -ENOENT;
    - break;
    - default:
    - err = -EIO;
    - break;
    + if (rl->lcn != (LCN)LCN_RL_NOT_MAPPED) {
    + if (rl->lcn == (LCN)LCN_ENOENT)
    + err = -ENOENT;
    + else
    + err = -EIO;
                     }
             }
             if (!need_write)

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Maneesh Soni: "[PATCH 4/5] Change sysfs_file_operations"

    Relevant Pages

    • Re: removing bcopy... because its half broken
      ... It still emits calls to libgcc. ... I disagree with your first sentence: The kernel provides the required ... it no longer gets emitted by gcc since ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Fix NR_KEYS off-by-one error
      ... > larger types (short or int, ... Probably gcc not warn, I think. ... > You are absolutely correct that overhead is insignificant. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Build for Generic Linux Solved?
      ... versions of the shared libs on it, ... I've read the man page for ld and for gcc, ... I used to use it to generate a make file rule, ... use the -static option to only include the libgcc so that you aviod the ...
      (Fedora)
    • oops when copying from IDE CD
      ... gcc version 3.3.2 20030908 ... I haven't got any experience in reporting kernel panics, ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: Problems Building Bluetooth with K6 and CONFIG_REGPARM
      ... >>Hi Andy, ... > Sounds like a compiler bug, especially since changing the CPU type fixes ... I was using Debian's GCC 4.0.1-6. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)