bugGNU GRUB - Bugs: bug #11808, GRUB 0.96 Compilation Error

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #11808: GRUB 0.96 Compilation Error

Submitter:  None
Submitted:  Tue 01 Feb 2005 07:25:02 PM UTC
   
 
Category:  Compilation Severity:  Major
Priority:  3 - Low Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  Haren Visavadia
Originator Email:  -email is unavailable- Open/Closed:  Closed
Release:  None Release:  0.96
Reproducibility:  Every Time Planned Release:  None

Jump to the original submission

Fri 04 Feb 2005 10:25:52 PM UTC, comment #7: 

Thank you very much for your help. I can now close this bug. :)

Yoshinori K. Okuji <okuji>
Group administrator
Fri 04 Feb 2005 08:14:34 AM UTC, comment #6: 

Now building grub straight out of CVS with GCC 4.0 works for me without any problems.

Thank you

Haren Visavadia

Anonymous
Thu 03 Feb 2005 10:03:59 PM UTC, comment #5: 

I checked in another patch.

BTW, please use "make -k" next time to detect all errors.

Okuji

Yoshinori K. Okuji <okuji>
Group administrator
Thu 03 Feb 2005 09:32:06 AM UTC, comment #4: 

Now building grub straight out of CVS with GCC 4.0, I get the following error:

then mv -f ".deps/asmstub.Tpo" ".deps/asmstub.Po"; else rm -f ".deps/asmstub.Tpo"; exit 1; fi
asmstub.c:93: error: static declaration of 'console_current_color' follows non-static declaration
../stage2/term.h:93: error: previous declaration of 'console_current_color' was here
asmstub.c: In function 'grub_stage2':
asmstub.c:116: warning: type qualifiers ignored on function return type
asmstub.c:121: warning: function definition has qualified void return type
make[2]: * [asmstub.o] Error 1
make[2]: Leaving directory `/sources/Misc/grub/grub'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/sources/Misc/grub'
make: * [all] Error 2

It's related to the static declaration of console_current_color variable being modified later on in asmstub.c.

Haren Visavadia

Anonymous
Wed 02 Feb 2005 08:42:04 PM UTC, comment #3: 

I checked in my own patch. If this works for you, I will close this bug.

Yoshinori K. Okuji <okuji>
Group administrator
Wed 02 Feb 2005 05:49:46 PM UTC, comment #2: 

The CVS version, resolves the problem with bultins.c however now get the following error with gcc-4:

Po"; else rm -f ".deps/pre_stage2_exec-smp-imps.Tpo"; exit 1; fi
smp-imps.c:252: error: static declaration of 'imps_any_new_apics' follows non-st                                                             atic declaration
smp-imps.h:190: error: previous declaration of 'imps_any_new_apics' was here
smp-imps.c:256: error: static declaration of 'imps_enabled' follows non-static d                                                             eclaration
smp-imps.h:196: error: previous declaration of 'imps_enabled' was here
smp-imps.c:257: error: static declaration of 'imps_num_cpus' follows non-static                                                              declaration
smp-imps.h:206: error: previous declaration of 'imps_num_cpus' was here
smp-imps.c:258: error: static declaration of 'imps_lapic_addr' follows non-stati                                                             c declaration
smp-imps.h:201: error: previous declaration of 'imps_lapic_addr' was here
smp-imps.c:259: error: static declaration of 'imps_cpu_apic_map' follows non-sta                                                             tic declaration
smp-imps.h:211: error: previous declaration of 'imps_cpu_apic_map' was here
smp-imps.c:260: error: static declaration of 'imps_apic_cpu_map' follows non-sta                                                             tic declaration
smp-imps.h:212: error: previous declaration of 'imps_apic_cpu_map' was here
make[2]: * [pre_stage2_exec-smp-imps.o] Error 1
make[2]: Leaving directory `/sources/Misc/grub/stage2'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/sources/Misc/grub'
make: * [all] Error 2

Neverthless, I have created a patch, that removes some these static variables that are modified and also removed -fwriteable-strings from the Makefile as this is not supported by GCC-4.0. The patch I created has been tested and is known to work for me.

Haren Visavadia

Anonymous
Tue 01 Feb 2005 09:03:54 PM UTC, comment #1: 

I have checked in a patch to the CVS for your problem right now. Could you test the CVS version with gcc-4?

Okuji

Yoshinori K. Okuji <okuji>
Group administrator
Tue 01 Feb 2005 07:25:02 PM UTC, original submission:  

Known to work: gcc-3.4-20050121 (ftp://gcc.gnu.org/pub/gcc/snapshots/3.4-20050121/gcc-3.4-20050121.tar.bz2)

Known to fail: gcc-4.0-20050123 (ftp://gcc.gnu.org/pub/gcc/snapshots/4.0-20050123/gcc-4.0-20050123.tar.bz2)

In both case Binutils 2.15 was used

When compiling grub 0.96 using gcc-4.0-20050123, the following compile error shows:

builtins.c: In function 'blocklist_func':
builtins.c:145: error: invalid storage class for function 'disk_read_blocklist_func'
builtins.c:145: warning: no previous prototype for 'disk_read_blocklist_func'
builtins.c: In function 'color_func':
builtins.c:592: error: invalid storage class for function 'color_number'
builtins.c:592: warning: no previous prototype for 'color_number'
builtins.c: In function 'install_func':
builtins.c:1751: error: invalid storage class for function 'disk_read_savesect_func'
builtins.c:1751: warning: no previous prototype for 'disk_read_savesect_func'
builtins.c:1767: error: invalid storage class for function 'disk_read_blocklist_func'
builtins.c:1767: warning: no previous prototype for 'disk_read_blocklist_func'
builtins.c: In function 'setkey_func':
builtins.c:3499: error: invalid storage class for function 'find_key_code'
builtins.c:3499: warning: no previous prototype for 'find_key_code'
builtins.c:3516: error: invalid storage class for function 'find_ascii_code'
builtins.c:3516: warning: no previous prototype for 'find_ascii_code'
make[2]: * [pre_stage2_exec-builtins.o] Error 1
make[2]: Leaving directory `/sources/Misc/grub-0.95/stage2'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/sources/Misc/grub-0.95'
make: * [all] Error 2

From looking at the builtins.c, it appears to related to way grub uses the keyword static.

Futhermore, gcc-4.0-20050123 is able to compile:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static void print(char * message)
{
printf(message);
printf("\n");
}

int main() {
print("hello world");
return 0;
}
Making this not a gcc-4.0-20050123 bug unless you can convice me.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #2482:  grub-fixes.patch added by None (3KiB - application/octet-stream - Removal static variables that are modified and removal of -fwriteable-strings in Makefile)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-02-04 okuji StatusNone Fixed
    Open/ClosedOpen Closed
2005-02-02 None Attached File- Added grub-fixes.patch, #2142
2005-02-01 okuji Priority5 - Normal 3 - Low
    Item GroupAction Request Software Error

Back to the top

Powered by Savane 3.13-3230.
Corresponding source code