Problem compiling kernel 2.4.7 with gcc 2.96
Hi folks
When creating the modules (make modules) for my 2.4.7 kernel the compilation aborts with the following error message. I used the standard Red Hat 7.1 kernel configuration file with only minor modifications.
gcc -D__KERNEL__ -I/usr/src/linux-2.4.7/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS
-include /usr/src/linux-2.4.7/include/linux/modversions.h -c -o xd.o xd.c
gcc -D__KERNEL__ -I/usr/src/linux-2.4.7/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS
-include /usr/src/linux-2.4.7/include/linux/modversions.h -c -o cpqarray.ocpqarray.c
gcc -D__KERNEL__ -I/usr/src/linux-2.4.7/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS
-include /usr/src/linux-2.4.7/include/linux/modversions.h -c -o cciss.o
cciss.cgcc -D__KERNEL__ -I/usr/src/linux-2.4.7/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include/usr/src/linux-2.4.7/include/linux/modversions.h -DEXPORT_SYMTAB -c DAC960.cDAC960.c: In function `DAC960_ProcessRequest':
DAC960.c:2771: structure has no member named `sem'
make[2]: *** [DAC960.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.4.7/drivers/block' make[1]: *** [_modsubdir_block] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.7/drivers'
make: *** [_mod_drivers] Error 2
[root@localhost linux]#
I have run the ver_linux script as recommended. Here is the output.
[root@localhost linux]# sh scripts/ver_linux
If some fields are empty or look unusual you may have an old version. Compare to the current minimal requirements in Documentation/Changes.
Linux localhost.localdomain 2.4.6 #1 Thu Jul 5 08:40:51 CEST 2001 i686 unknown
Gnu C 2.96 Gnu make 3.79.1 binutils 2.10.91.0.2 util-linux 2.10s mount 2.10r modutils 2.4.2 e2fsprogs 1.19 reiserfsprogs 3.x.0f PPP 2.4.0 isdn4k-utils 3.1pre1 Linux C Library 2.2.2 Dynamic linker (ldd) 2.2.2 Procps 2.0.7 Net-tools 1.57 Console-tools 0.3.3 Sh-utils 2.0 Modules Loaded ppp_async ppp_generic binfmt_misc autofs scanner 3c59x
ipchains parport_pc ppa parport ide-scsi scsi_mod ide-cd cdrom ntfs nls_iso8859-1 nls_cp437 vfat fat reiserfs usb-uhci usbcore [root@localhost linux]#
Maybe someone has an idea.
Bye, Peter.
Quoted 2 lines · Peter Klotz
DAC960.c: In function `DAC960_ProcessRequest':
DAC960.c:2771: structure has no member named `sem'
Attached patch should work
Signature · 1 line
Jens Axboe
drivers/block/DAC960.c renamed from drivers/block/DAC960.c~ +29 -37
@@ -40,6 +40,7 @@#include <linux/spinlock.h> #include <linux/timer.h> #include <linux/pci.h> +#include <linux/completion.h> #include <asm/io.h> #include <asm/segment.h> #include <asm/uaccess.h>
@@ -484,14 +485,14 @@static void DAC960_ExecuteCommand (DAC960_Command_T *Command) {DAC960_Controller_T *Controller = Command->Controller; -DECLARE_MUTEX_LOCKED (Semaphore); +DECLARE_COMPLETION (Wait);unsigned long ProcessorFlags; - Command->Semaphore = &Semaphore; + Command->Waiting = &Wait;DAC960_AcquireControllerLock (Controller, &ProcessorFlags);DAC960_QueueCommand (Command);DAC960_ReleaseControllerLock (Controller, &ProcessorFlags);if (in_interrupt ())return ; -down (&Semaphore); +wait_for_completion (&Wait); }
@@ -1316,7 +1317,7 @@ *Controller) {DAC960_V1_DCDB_T DCDBs[DAC960_V1_MaxChannels], *DCDB ; -Semaphore_T Semaphores[DAC960_V1_MaxChannels], *Semaphore; +Completion_T Wait[DAC960_V1_MaxChannels], *wait;unsigned long ProcessorFlags;int Channel, TargetID;for (TargetID =0 ; TargetID < Controller->Targets; TargetID++)
@@ -1327,12 +1328,12 @@DAC960_SCSI_Inquiry_T *InquiryStandardData = &Controller->V1.InquiryStandardData[Channel][TargetID]; InquiryStandardData->PeripheralDeviceType =0x1F ; - Semaphore = &Semaphores[Channel]; -init_MUTEX_LOCKED (Semaphore); + wait = &Wait[Channel]; +init_completion (wait);DCDB = &DCDBs[Channel];DAC960_V1_ClearCommand (Command); Command->CommandType = DAC960_ImmediateCommand; - Command->Semaphore = Semaphore; + Command->Waiting = wait; Command->V1.CommandMailbox.Type3.CommandOpcode =DAC960_V1_DCDB ; Command->V1.CommandMailbox.Type3.BusAddress =Virtual_to_Bus32 (DCDB );DCDB ->Channel = Channel;
@@ -1363,11 +1364,11 @@DAC960_SCSI_Inquiry_UnitSerialNumber_T *InquiryUnitSerialNumber = &Controller->V1.InquiryUnitSerialNumber[Channel][TargetID]; InquiryUnitSerialNumber->PeripheralDeviceType =0x1F ; - Semaphore = &Semaphores[Channel]; -down (Semaphore); + wait = &Wait[Channel]; +wait_for_completion (wait);if (Command->V1.CommandStatus != DAC960_V1_NormalCompletion)continue ; - Command->Semaphore = Semaphore; + Command->Waiting = wait;DCDB = &DCDBs[Channel];DCDB ->TransferLength =sizeof (DAC960_SCSI_Inquiry_UnitSerialNumber_T);DCDB ->BusAddress =Virtual_to_Bus32 (InquiryUnitSerialNumber);
@@ -1381,7 +1382,7 @@DAC960_AcquireControllerLock (Controller, &ProcessorFlags);DAC960_QueueCommand (Command);DAC960_ReleaseControllerLock (Controller, &ProcessorFlags); -down (Semaphore); +wait_for_completion (wait); } }return true;
@@ -2768,7 +2769,7 @@if (Request->cmd ==READ ) Command->CommandType = DAC960_ReadCommand;else Command->CommandType = DAC960_WriteCommand; - Command->Semaphore = Request->sem; + Command->Waiting = Request->waiting; Command->LogicalDriveNumber =DAC960_LogicalDriveNumber (Request->rq_dev); Command->BlockNumber = Request->sector
@@ -2924,10 +2925,10 @@/* Wake up requestor for swap file paging requests. */ -if (Command->Semaphore !=NULL ) +if (Command->Waiting) { -up (Command->Semaphore); - Command->Semaphore =NULL ; +complete (Command->Waiting); + Command->Waiting =NULL ; }add_blkdev_randomness (DAC960_MAJOR + Controller->ControllerNumber); }
@@ -2969,13 +2970,10 @@DAC960_ProcessCompletedBuffer (BufferHeader, false); BufferHeader = NextBufferHeader; } -/* -Wake up requestor for swap file paging requests. -*/ -if (Command->Semaphore !=NULL ) +if (Command->Waiting) { -up (Command->Semaphore); - Command->Semaphore =NULL ; +complete (Command->Waiting); + Command->Waiting =NULL ; } } }
@@ -3589,8 +3587,8 @@ }if (CommandType == DAC960_ImmediateCommand) { -up (Command->Semaphore); - Command->Semaphore =NULL ; +complete (Command->Waiting); + Command->Waiting =NULL ;return ; }if (CommandType == DAC960_QueuedCommand)
@@ -3931,13 +3929,10 @@DAC960_ProcessCompletedBuffer (BufferHeader, true); BufferHeader = NextBufferHeader; } -/* -Wake up requestor for swap file paging requests. -*/ -if (Command->Semaphore !=NULL ) +if (Command->Waiting) { -up (Command->Semaphore); - Command->Semaphore =NULL ; +complete (Command->Waiting); + Command->Waiting =NULL ; }add_blkdev_randomness (DAC960_MAJOR + Controller->ControllerNumber); }
@@ -3979,13 +3974,10 @@DAC960_ProcessCompletedBuffer (BufferHeader, false); BufferHeader = NextBufferHeader; } -/* -Wake up requestor for swap file paging requests. -*/ -if (Command->Semaphore !=NULL ) +if (Command->Waiting) { -up (Command->Semaphore); - Command->Semaphore =NULL ; +complete (Command->Waiting); + Command->Waiting =NULL ; } } }
@@ -4539,8 +4531,8 @@ }if (CommandType == DAC960_ImmediateCommand) { -up (Command->Semaphore); - Command->Semaphore =NULL ; +complete (Command->Waiting); + Command->Waiting =NULL ;return ; }if (CommandType == DAC960_QueuedCommand)
drivers/block/DAC960.h renamed from drivers/block/DAC960.h~ +2 -2
@@ -2153,7 +2153,7 @@typedef struct pt_regs Registers_T ;typedef struct request IO_Request_T ;typedef request_queue_t RequestQueue_T ; -typedef struct semaphore Semaphore_T ; +typedef struct completion Completion_T ;typedef struct super_block SuperBlock_T ;typedef struct timer_list Timer_T ;typedef wait_queue_head_t WaitQueue_T ;
@@ -2220,7 +2220,7 @@DAC960_CommandType_T CommandType;struct DAC960_Controller *Controller;struct DAC960_Command *Next; -Semaphore_T *Semaphore; +Completion_T *Waiting;unsigned int LogicalDriveNumber;unsigned int BlockNumber;unsigned int BlockCount;