Scsi on sparc build break in 2.6.23.
CONFIG_SCSI_SUNESP=y breaks the build in 2.6.23:
LD vmlinuxscsi_esp_unregister' referenced in section __ksymtab' of drivers/built-in.o:
defined in discarded section `.exit.text' of drivers/built-in.o
make: *** [vmlinux] Error 1
Do you need my full .config to reproduce this?
Rob
Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.
Quoted 8 lines · Rob Landley
CONFIG_SCSI_SUNESP=ybreaks the build in 2.6.23:LD vmlinux
scsi_esp_unregister' referenced in section__ksymtab' ofdrivers/built-in.o:
defined in discarded section `.exit.text' ofdrivers/built-in.o
make: *** [vmlinux] Error 1Do you need my full .config to reproduce this?
Please always attach the .config when reporting errors. The few bytes don't matter and it often saves some time.
I have an idea regarding what might be going wrong in this case, but it would cost me additional time to look at it because you didn't send your .config.
Quoted 1 line
Rob
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 9 lines · Adrian Bunk
Quoted 8 lines · Rob Landley
CONFIG_SCSI_SUNESP=ybreaks the build in 2.6.23:LD vmlinux
scsi_esp_unregister' referenced in section__ksymtab' ofdrivers/built-in.o: defined in discarded section `.exit.text' ofdrivers/built-in.o
make: *** [vmlinux] Error 1
Quoted 8 lines
Quoted 1 line
Do you need my full .config to reproduce this?
Please always attach the .config when reporting errors. The few bytes don't matter and it often saves some time.
I have an idea regarding what might be going wrong in this case, but it would cost me additional time to look at it because you didn't send your .config.
*shrug* That's why I asked.
The reason I hesitated is I use miniconfig files rather than big .config files, and some people get confused by that. Drop the attached miniconfig-linux in the kernel source directory and go:
make ARCH=sparc allnoconfig KCONFIG_ALLCONFIG=miniconfig-linux
That expands it to a big .config file, and from there "make ARCH=sparc CROSS_COMPILE=sparc-" to reproduce the problem. Assuming you have a sparc cross-compiler lying around.
Disable CONFIG_SCSI_SUNESP and it builds to the end, (and the result boots but won't mount the root filesystem, which is sort of expected).
Rob
Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.
CONFIG_EXPERIMENTAL=yCONFIG_SWAP=yCONFIG_SYSVIPC=yCONFIG_IKCONFIG=yCONFIG_IKCONFIG_PROC=yCONFIG_EMBEDDED=yCONFIG_UID16=yCONFIG_SYSCTL_SYSCALL=yCONFIG_PRINTK=yCONFIG_BUG=yCONFIG_ELF_CORE=yCONFIG_BASE_FULL=yCONFIG_FUTEX=yCONFIG_EPOLL=yCONFIG_SHMEM=yCONFIG_SLAB=yCONFIG_VM_EVENT_COUNTERS=yCONFIG_MODULES=yCONFIG_MODULE_UNLOAD=yCONFIG_MODULE_FORCE_UNLOAD=yCONFIG_KMOD=yCONFIG_BLOCK=yCONFIG_IOSCHED_AS=yCONFIG_IOSCHED_DEADLINE=yCONFIG_BINFMT_ELF=yCONFIG_NET=yCONFIG_PACKET=yCONFIG_UNIX=yCONFIG_INET=yCONFIG_IP_MULTICAST=yCONFIG_IP_ADVANCED_ROUTER=yCONFIG_IP_PNP=yCONFIG_INET_DIAG=yCONFIG_NETFILTER=yCONFIG_VLAN_8021Q=yCONFIG_STANDALONE=yCONFIG_PREVENT_FIRMWARE_BUILD=yCONFIG_BLK_DEV=yCONFIG_BLK_DEV_RAM=yCONFIG_BLK_DEV_RAM_COUNT=4CONFIG_BLK_DEV_INITRD=yCONFIG_SCSI=yCONFIG_SCSI_LOWLEVEL=yCONFIG_SCSI_PROC_FS=yCONFIG_BLK_DEV_SD=yCONFIG_BLK_DEV_SR=yCONFIG_SCSI_SUNESP=yCONFIG_NETDEVICES=yCONFIG_DUMMY=yCONFIG_NET_ETHERNET=yCONFIG_MII=yCONFIG_SUNLANCE=yCONFIG_INPUT=yCONFIG_INPUT_KEYBOARD=yCONFIG_KEYBOARD_ATKBD=yCONFIG_INPUT_MOUSE=yCONFIG_MOUSE_PS2=yCONFIG_SERIAL_SUNZILOG=yCONFIG_SERIAL_SUNZILOG_CONSOLE=yCONFIG_UNIX98_PTYS=yCONFIG_HWMON=yCONFIG_FIRMWARE_EDID=yCONFIG_UNIX98_PTY_COUNT=64CONFIG_EXT2_FS=yCONFIG_EXT2_FS_XATTR=yCONFIG_EXT3_FS=yCONFIG_EXT3_FS_XATTR=yCONFIG_INOTIFY=yCONFIG_INOTIFY_USER=yCONFIG_DNOTIFY=yCONFIG_ISO9660_FS=yCONFIG_PROC_FS=yCONFIG_PROC_KCORE=yCONFIG_PROC_SYSCTL=yCONFIG_SYSFS=yCONFIG_TMPFS=yCONFIG_NLS=yCONFIG_NLS_DEFAULT="ascii"CONFIG_NLS_CODEPAGE_437=yCONFIG_NLS_CODEPAGE_850=yCONFIG_NLS_ASCII=yCONFIG_NLS_ISO8859_1=yCONFIG_PRINTK_TIME=yCONFIG_ENABLE_MUST_CHECK=yCONFIG_MAGIC_SYSRQ=yCONFIG_DEBUG_KERNEL=yCONFIG_LOG_BUF_SHIFT=15CONFIG_DETECT_SOFTLOCKUP=yCONFIG_DEBUG_SLAB=yCONFIG_DEBUG_SPINLOCK=yCONFIG_DEBUG_SPINLOCK_SLEEP=yCONFIG_DEBUG_KOBJECT=yCONFIG_DEBUG_BUGVERBOSE=yCONFIG_DEBUG_INFO=yCONFIG_UNWIND_INFO=yCONFIG_FORCED_INLINING=yCONFIG_SECURITY=yCONFIG_SECURITY_CAPABILITIES=yCONFIG_SQUASHFS=y
Quoted 26 lines · Rob Landley
Quoted 9 lines · Adrian Bunk
Quoted 8 lines · Rob Landley
CONFIG_SCSI_SUNESP=ybreaks the build in 2.6.23:LD vmlinux
scsi_esp_unregister' referenced in section__ksymtab' ofdrivers/built-in.o: defined in discarded section `.exit.text' ofdrivers/built-in.o
make: *** [vmlinux] Error 1Quoted 8 lines
Quoted 1 line
Do you need my full .config to reproduce this?
Please always attach the .config when reporting errors. The few bytes don't matter and it often saves some time.
I have an idea regarding what might be going wrong in this case, but it would cost me additional time to look at it because you didn't send your .config.
*shrug* That's why I asked.
The reason I hesitated is I use miniconfig files rather than big .config files, and some people get confused by that. Drop the attached miniconfig-linux in the kernel source directory and go:
make ARCH=sparc allnoconfig KCONFIG_ALLCONFIG=miniconfig-linux
Quoted 6 lines
That expands it to a big .config file, and from there "make ARCH=sparc CROSS_COMPILE=sparc-" to reproduce the problem. Assuming you have a sparc cross-compiler lying around.
Disable
CONFIG_SCSI_SUNESPand it builds to the end, (and the result boots but won't mount the root filesystem, which is sort of expected).
This is a very subtle error. You're building without hotplug, which causes __devexit to become __exit, so scsi_esp_unregister is placed in the discard section of vmlinux. Unfortunately, the EXPORT_SYMBOL causes it to be referenced from the symbol export table.
The fix is probably just to remove the __devexit tag from the function rather than trying to work out how to make the export symbol conditional on the symbol not being discarded.
James
PATCH 1/1 esp_scsi.c: remove __dev{init,exit}
Quoted 34 lines · James Bottomley
Quoted 26 lines · Rob Landley
Quoted 9 lines · Adrian Bunk
Quoted 8 lines · Rob Landley
CONFIG_SCSI_SUNESP=ybreaks the build in 2.6.23:LD vmlinux
scsi_esp_unregister' referenced in section__ksymtab' ofdrivers/built-in.o: defined in discarded section `.exit.text' ofdrivers/built-in.o
make: *** [vmlinux] Error 1Quoted 8 lines
Quoted 1 line
Do you need my full .config to reproduce this?
Please always attach the .config when reporting errors. The few bytes don't matter and it often saves some time.
I have an idea regarding what might be going wrong in this case, but it would cost me additional time to look at it because you didn't send your .config.
*shrug* That's why I asked.
The reason I hesitated is I use miniconfig files rather than big .config files, and some people get confused by that. Drop the attached miniconfig-linux in the kernel source directory and go:
make ARCH=sparc allnoconfig KCONFIG_ALLCONFIG=miniconfig-linuxQuoted 6 lines
That expands it to a big .config file, and from there "make ARCH=sparc CROSS_COMPILE=sparc-" to reproduce the problem. Assuming you have a sparc cross-compiler lying around.
Disable
CONFIG_SCSI_SUNESPand it builds to the end, (and the result boots but won't mount the root filesystem, which is sort of expected).
Quoted 8 lines
This is a very subtle error. You're building without hotplug, which causes
__devexitto become__exit, soscsi_esp_unregisteris placed in the discard section of vmlinux. Unfortunately, theEXPORT_SYMBOLcauses it to be referenced from the symbol export table.The fix is probably just to remove the
__devexittag from the function rather than trying to work out how to make the export symbol conditional on the symbol not being discarded.
You can't make it conditional on that since a built-in esp_scsi could have modular users.
scsi_esp_register() is also buggy since it's impossible that the EXPORT_SYMBOL(scsi_esp_register) works in the CONFIG_HOTPLUG=n case when it's __devinit - it will always Oops.
Having anything exported __{,dev}{init,exit} is always very likely to be buggy.
Patch below.
Quoted 1 line
James
cu
Adrian
<-- snip -->
Since scsi_esp_{,un}register() are EXPORT_SYMBOL'ed, these functions (and the functions they use) can't be __dev{init,exit}.
Based on a bug report by Rob Landley.
---
drivers/scsi/esp_scsi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/esp_scsi.c renamed from drivers/scsi/esp_scsi.c.old +5 -5
@@ -2138,7 +2138,7 @@ }EXPORT_SYMBOL (scsi_esp_intr); -static void __devinit esp_get_revision (struct esp *esp) +static void esp_get_revision (struct esp *esp) {u8 val;
@@ -2187,7 +2187,7 @@ } } -static void __devinit esp_init_swstate (struct esp *esp) +static void esp_init_swstate (struct esp *esp) {int i;
@@ -2233,7 +2233,7 @@esp_read8 (ESP_INTRPT ); } -static void __devinit esp_set_clock_params (struct esp *esp) +static void esp_set_clock_params (struct esp *esp) {int fmhz;u8 ccf;
@@ -2306,7 +2306,7 @@static struct scsi_transport_template *esp_transport_template; -int __devinit scsi_esp_register (struct esp *esp,struct device *dev) +int scsi_esp_register (struct esp *esp,struct device *dev) {static int instance;int err;
@@ -2346,7 +2346,7 @@ }EXPORT_SYMBOL (scsi_esp_register); -void __devexit scsi_esp_unregister(struct esp *esp) +void scsi_esp_unregister (struct esp *esp) {scsi_remove_host (esp->host); }
Re: [2.6 patch] esp_scsi.c: remove __dev{init,exit}
Quoted 6 lines · Adrian Bunk
Since scsi_esp_{,un}register() are EXPORT_SYMBOL'ed, these functions (and the functions they use) can't be __dev{init,exit}.
Based on a bug report by Rob Landley.
Signed-off-by Adrian Bunk <[email protected]>
Worked for me...
Rob
Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.
David Miller
Acked-byRe: [2.6 patch] esp_scsi.c: remove __dev{init,exit}
From: Rob Landley <[email protected]>
Date: Thu, 11 Oct 2007 17:47:02 -0500
Quoted 9 lines · Adrian Bunk
Quoted 6 lines
Since scsi_esp_{,un}register() are EXPORT_SYMBOL'ed, these functions (and the functions they use) can't be __dev{init,exit}.
Based on a bug report by Rob Landley.
Signed-off-by Adrian Bunk <[email protected]>Acked-by Rob Landley <[email protected]>
I'm fine with this fix too.
Re: [2.6 patch] esp_scsi.c: remove __dev{init,exit}
Quoted 9 lines · David Miller
From: Rob Landley <[email protected]>
Date: Thu, 11 Oct 2007 17:47:02 -0500Quoted 6 lines · Adrian Bunk
Quoted 5 lines
Since scsi_esp_{,un}register() are EXPORT_SYMBOL'ed, these functions (and the functions they use) can't be __dev{init,exit}.
Based on a bug report by Rob Landley.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Adrian Bunk <[email protected]>Acked-by Rob Landley <[email protected]>I'm fine with this fix too.
Acked-by David S. Miller <[email protected]>
Did this already go to the -stable guys for 2.6.23.2?
Rob
Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.
Quoted 19 lines · Rob Landley
Quoted 9 lines · Adrian Bunk
Quoted 8 lines · Rob Landley
CONFIG_SCSI_SUNESP=ybreaks the build in 2.6.23:LD vmlinux
scsi_esp_unregister' referenced in section__ksymtab' ofdrivers/built-in.o: defined in discarded section `.exit.text' ofdrivers/built-in.o
make: *** [vmlinux] Error 1Quoted 8 lines
Quoted 1 line
Do you need my full .config to reproduce this?
Please always attach the .config when reporting errors. The few bytes don't matter and it often saves some time.
I have an idea regarding what might be going wrong in this case, but it would cost me additional time to look at it because you didn't send your .config.
Quoted 7 lines
*shrug* That's why I asked.
The reason I hesitated is I use miniconfig files rather than big .config files, and some people get confused by that. Drop the attached miniconfig-linux in the kernel source directory and go:
make ARCH=sparc allnoconfig KCONFIG_ALLCONFIG=miniconfig-linux
...
I assume you have the full .config in your build directory, and could have taken it from there?
Quoted 1 line
Rob
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedA message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Rob Landley
Quoted 2 lines · Adrian Bunk
I assume you have the full .config in your build directory, and could have taken it from there?
Actually I don't. (The extracted source tree is in a temporary directory which the script deletes afterwards unless I tell it not to. I just followed my own instructions to create the .config and attach it, but I see that James Bottomley already diagnosed it and you came up with a patch. Off to try it...)
I was able to follow your instructions for generating it.
But I hope you got my point that it's much easier to debug such issues when you generate the .config yourself and attach it when sending the bug report.
Quoted 1 line
Rob
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 11 lines · On Fri, 12 Oct 2007 01:56:59 +0200 Adrian Bunk wrote:
Quoted 9 lines · Rob Landley
Quoted 2 lines · Adrian Bunk
I assume you have the full .config in your build directory, and could have taken it from there?
Actually I don't. (The extracted source tree is in a temporary directory which the script deletes afterwards unless I tell it not to. I just followed my own instructions to create the .config and attach it, but I see that James Bottomley already diagnosed it and you came up with a patch. Off to try it...)
Quoted 5 lines
I was able to follow your instructions for generating it.
But I hope you got my point that it's much easier to debug such issues when you generate the .config yourself and attach it when sending the bug report.
I use the mini-config method quite a bit (probably not as much as Rob does), but I agree with Adrian, it should have just been included here in full (not mini).
---
~Randy
Quoted 11 lines · Adrian Bunk
Quoted 9 lines · Rob Landley
Quoted 2 lines · Adrian Bunk
I assume you have the full .config in your build directory, and could have taken it from there?
Actually I don't. (The extracted source tree is in a temporary directory which the script deletes afterwards unless I tell it not to. I just followed my own instructions to create the .config and attach it, but I see that James Bottomley already diagnosed it and you came up with a patch. Off to try it...)
Quoted 5 lines
I was able to follow your instructions for generating it.
But I hope you got my point that it's much easier to debug such issues when you generate the .config yourself and attach it when sending the bug report.
*shrug* I find miniconfig much easier to read because I can see what the 50 or so intentional options are, not just the 1000 or so background options set to various default values.
Rob
Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code." - Ken Thompson.
Quoted 14 lines · Rob Landley
Quoted 13 lines · Adrian Bunk
Quoted 9 lines · Rob Landley
Quoted 2 lines · Adrian Bunk
I assume you have the full .config in your build directory, and could have taken it from there?
Actually I don't. (The extracted source tree is in a temporary directory which the script deletes afterwards unless I tell it not to. I just followed my own instructions to create the .config and attach it, but I see that James Bottomley already diagnosed it and you came up with a patch. Off to try it...)
I was able to follow your instructions for generating it.
Quoted 7 lines
Quoted 3 lines
But I hope you got my point that it's much easier to debug such issues when you generate the .config yourself and attach it when sending the bug report.
*shrug* I find miniconfig much easier to read because I can see what the 50 or so intentional options are, not just the 1000 or so background options set to various default values.
The .config is the canonical format everyone is used to.
It also has advantages like a defined order of the options.
And it is actually an advantage that you see what the other options are set to (e.g. in this case your miniconfig did not show the value of CONFIG_HOTPLUG which was the most important option for understanding the bug) - it doesn't matter whether you {dis,en}abled it intentionally, all that matter is it's value.
There might be use cases where a miniconfig is better, but for debugging compile errors a full .config is much better.
Quoted 1 line
Rob
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed