[PATCH] Re: 2.4.0-test1-ac4 link problem

From: Andries Brouwer (aeb@veritas.com)
Date: Mon May 29 2000 - 14:47:35 EST


Roger Gammans writes:

: When I try to build 2.5.0-test1-ac4 I get the following error:
:
: fs/fs.o(.text+0x1fce9): undefined reference to `ide_xlate_1024'

Somewhat earlier Arjan van de Ven wrote:

:: Subject: Re: 2.3.99pre2-3: ide_xlate_1024 not linked in

There has been a bit of uncertainty about the proper defines here.
The patch below fixes things by changing ide-geometry.c.

Philosophy:
This file exports two routines: probe_cmos_for_drives() and ide_xlate_1024().
The former is used by ide-probe.c and must be available (under CONFIG_IDE,
but without that we wouldnt be in the ide directory).
The latter is used in partitions/msdos.c (under CONFIG_BLK_DEV_IDE)
so must have precisely the same condition here.
It calls get_info_ptr() and current_capacity(), and these are unavailable
when we have hd.c only. On the other hand, the !defined(CONFIG_BLK_DEV_HD)
is wrong because we may have both hd.c and ide.c.

Andries

diff -u --recursive --new-file ../linux-2.4.0ac4/linux/drivers/ide/ide-geometry.c ./linux/drivers/ide/ide-geometry.c
--- ../linux-2.4.0ac4/linux/drivers/ide/ide-geometry.c Mon May 29 11:03:57 2000
+++ ./linux/drivers/ide/ide-geometry.c Mon May 29 20:51:47 2000
@@ -2,15 +2,9 @@
  * linux/drivers/ide/ide-geometry.c
  */
 #include <linux/config.h>
-
-#if defined(CONFIG_IDE) && !defined(CONFIG_BLK_DEV_HD)
 #include <linux/ide.h>
-
 #include <asm/io.h>
 
-extern ide_drive_t * get_info_ptr(kdev_t);
-extern unsigned long current_capacity (ide_drive_t *);
-
 /*
  * We query CMOS about hard disks : it could be that we have a SCSI/ESDI/etc
  * controller that is BIOS compatible with ST-506, and thus showing up in our
@@ -42,7 +36,7 @@
  * The code below is bad. One of the problems is that drives 1 and 2
  * may be SCSI disks (even when IDE disks are present), so that
  * the geometry we read here from BIOS is attributed to the wrong disks.
- * Consequently, also the "drive->present = 1" below is a mistake.
+ * Consequently, also the former "drive->present = 1" below was a mistake.
  *
  * Eventually the entire routine below should be removed.
  */
@@ -74,7 +68,8 @@
                                 drive->sect = drive->bios_sect = sect;
                                 drive->ctl = *(BIOS+8);
                         } else {
- printk("hd%d: C/H/S=%d/%d/%d from BIOS ignored\n", unit, cyl, head, sect);
+ printk("hd%d: C/H/S=%d/%d/%d from BIOS ignored\n",
+ unit, cyl, head, sect);
                         }
                 }
 
@@ -84,6 +79,11 @@
 }
 
 
+#ifdef CONFIG_BLK_DEV_IDE
+
+extern ide_drive_t * get_info_ptr(kdev_t);
+extern unsigned long current_capacity (ide_drive_t *);
+
 /*
  * If heads is nonzero: find a translation with this many heads and S=63.
  * Otherwise: find out how OnTrack Disk Manager would translate the disk.
@@ -211,4 +211,4 @@
                        drive->bios_cyl, drive->bios_head, drive->bios_sect);
         return ret;
 }
-#endif /* (CONFIG_IDE) && !(CONFIG_BLK_DEV_HD) */
+#endif /* CONFIG_BLK_DEV_IDE */

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



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:22 EST