Je n'est pas trouvé de façon plus explicite dans mon titre pour expliquer mon problème : il y a quelques mois j'ai suivi les explications du site OSDev pour télécharger et compiler GCC pour qu'il soit cross plateforme, tout marchait presque bien, mis à part quelque subtilité : en particulier je ne trouvais pas le fichier libgcc.a dans l'arborescence à laquelle j'avais installé GCC, de plus il y avait les binutils et gcc dans le même fichier, ça ne me plaisait pas j'ai donc voulu refaire les choses proprement. J'ai donc télécharger, compiler GCC 6.3.0 et les binutils dans des dossiers différents, mais quand j'utilisais GCC dans mon projet, il me sortait plein d'erreurs, j'ai donc ré installer la 5.4.0 et, alors que je n'ai jamais changer mon code source, il me sort les mêmes erreurs que la version 6.3.0 (ce qui est cohérent mais m'em***de bien) voici les erreurs :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:2:11: error: mach-o section specifier uses an unknown section type
        .section        .rodata.str1.1,"aMS",@progbits,1
                        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:11:11: error: mach-o section specifier uses an unknown section type
        .section        .text.unlikely,"ax",@progbits
                        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:17:2: error: unknown directive
        .type   _Z4initv, @function
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:21:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:24:2: error: instruction requires: Not 64-bit mode
        pushl   %ebx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:30:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:35:2: error: instruction requires: Not 64-bit mode
        pushl   $50
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:37:2: error: instruction requires: Not 64-bit mode
        pushl   $1024
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:40:2: error: instruction requires: Not 64-bit mode
        pushl   %ebx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:46:2: error: instruction requires: Not 64-bit mode
        popl    %eax
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:48:2: error: instruction requires: Not 64-bit mode
        popl    %edx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:50:2: error: instruction requires: Not 64-bit mode
        pushl   $.LC0
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:52:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:58:2: error: instruction requires: Not 64-bit mode
        popl    %ecx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:60:2: error: instruction requires: Not 64-bit mode
        popl    %eax
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:62:2: error: instruction requires: Not 64-bit mode
        pushl   $.LC1
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:64:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:70:2: error: instruction requires: Not 64-bit mode
        popl    %eax
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:72:2: error: instruction requires: Not 64-bit mode
        popl    %edx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:74:2: error: instruction requires: Not 64-bit mode
        pushl   $.LC2
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:76:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:82:2: error: instruction requires: Not 64-bit mode
        popl    %ecx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:84:2: error: instruction requires: Not 64-bit mode
        popl    %eax
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:86:2: error: instruction requires: Not 64-bit mode
        pushl   $.LC3
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:88:2: error: instruction requires: Not 64-bit mode
        pushl   %esi
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:92:2: error: instruction requires: Not 64-bit mode
        pushl   $152
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:94:2: error: instruction requires: Not 64-bit mode
        pushl   $1048575
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:96:2: error: instruction requires: Not 64-bit mode
        pushl   $0
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:98:2: error: instruction requires: Not 64-bit mode
        pushl   %ebx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:103:2: error: instruction requires: Not 64-bit mode
        pushl   $4
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:105:2: error: instruction requires: Not 64-bit mode
        pushl   $146
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:107:2: error: instruction requires: Not 64-bit mode
        pushl   $1048575
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:109:2: error: instruction requires: Not 64-bit mode
        pushl   $1048576
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:111:2: error: instruction requires: Not 64-bit mode
        pushl   %ebx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:116:2: error: instruction requires: Not 64-bit mode
        pushl   $4
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:118:2: error: instruction requires: Not 64-bit mode
        pushl   $150
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:120:2: error: instruction requires: Not 64-bit mode
        pushl   $1048575
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:122:2: error: instruction requires: Not 64-bit mode
        pushl   $2097152
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:124:2: error: instruction requires: Not 64-bit mode
        pushl   %ebx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:129:2: error: instruction requires: Not 64-bit mode
        pushl   %ebx
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:138:2: error: unknown directive
        .size   _Z4initv, .-_Z4initv
        ^
/var/folders/vp/ytlzwk9j0tg1krkknx4ytqbw0000gn/T//ccWoEes3.s:139:25: error: unexpected token in '.section' directive
        .section        .text.unlikely
Alors globalement il me dit qu'il ne connait pas une instruction compiler en 64bits, ok, normale je l'ai configurer pour créer un exécutable elf pour architecture i686 mais à aucun moment je ne lui ait demandé d'aller chercher ce fichier à la c** situé dans /var/... .J'ai toujours suivi exactement les mêmes étapes que sur OSDev, mais pour une raison inconnu son petit cerveau de compilateur veut aller chercher un fichier qu'il sort d'on ne sait trop où. Est-t-il possible qu'il inclus comme ça des fichier aléatoirement ? J'essaye de trouver la solution à ça depuis 2h mais là je suis à bout j'ai juste envie de mourir... :/ voici les options avec lesquelles je compile :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
-c -ffreestanding -lgcc -Wall -Wextra -O2 -O3 -I $(KERNEL_DIR)/include -I $(X86_DIR)/include -I $(LIBC_DIR)/include
J'ai fait des tests et quand je compile une simple fonction main qui ne fait rien ça marche sans problème mais quand je compile un code qui vient directement depuis OSDev avec exactement les mêmes options il me sort le même type d'erreur, alors que mon ancienne version de gcc 5.4.0 n'avait aucun problèmes. Merci de votre aide