Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Compilateur C] Ne marche plus (résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Mon Nov 14, 2005 5:13 pm    Post subject: [Compilateur C] Ne marche plus (résolu) Reply with quote

Bonjour,

J'essaye de compiler quelque chose, j'ai toujours des erreurs:
iptables => cc1: error: unrecognized option 'fvisibility-inlines-hidden'
alsa-lib => Le compilateur ne peut pas compiler les exécutables
linxml2 => pareil qu'alsa => configure: error: C compiler cannot create executables
[etc]

:cry:

gcc-3.3.6

Quelle betise ai-je fait?

Solution
Dans /etc/make.conf, supprimer l'attribut fvisibility-inlines-hidden de la ligne CFLAGS. Dans mon cas par exemple, j'utilise à présent
Code:
CFLAGS="-O2 -march=pentium2 -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
:)
Je crois (ceci veut dire que c'est très douteux) que l'option -fvisibility-inlines-hidden n'est disponible que pour le compilateur C++, pas C.


Last edited by digimag on Mon Nov 14, 2005 5:43 pm; edited 2 times in total
Back to top
View user's profile Send private message
kopp
Advocate
Advocate


Joined: 09 Apr 2004
Posts: 2885
Location: Grenoble, France

PostPosted: Mon Nov 14, 2005 5:18 pm    Post subject: Reply with quote

Ton gcc vient il d'être mis à jour ?
Que donne un
Code:
gcc-config -l
?
Si jamais il est sur une config qui ne correspond pas, et qu'après changement (man gcc-config), ça ne marche toujours pas :
Code:
fixlibtool.sh num_ancienne_version


Au passage : Peux tu lire ça : https://forums.gentoo.org/viewtopic-t-347528.html
Back to top
View user's profile Send private message
bob1977
Guru
Guru


Joined: 16 Mar 2004
Posts: 387

PostPosted: Mon Nov 14, 2005 5:21 pm    Post subject: Reply with quote

Salut digimag,

T'es sur que le Cflag 'fvisibility-inline-hidden' existe?
Au cas ou, verifie dans ton make.conf qu'il n'y ait pas d'erreur.
Back to top
View user's profile Send private message
widan
Veteran
Veteran


Joined: 07 Jun 2005
Posts: 1512
Location: Paris, France

PostPosted: Mon Nov 14, 2005 5:24 pm    Post subject: Re: [Compilateur C] Ne marche plus Reply with quote

digimag wrote:
iptables => cc1: error: unrecognized option 'fvisibility-inline-hidden'

Vérifie tes CFLAGS, c'est "-fvisibility-inlines-hidden".
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Mon Nov 14, 2005 5:26 pm    Post subject: Reply with quote

Widan => Ah ok... C'était ça donc, le "s" oublié.

Hum, avant je n'avais pas d'erreur. Ben je vais essayer avec ta corréction!
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Mon Nov 14, 2005 5:30 pm    Post subject: Reply with quote

Widan => Si j'ajoute le "s", rien ne change. :roll:

Voir l'édition de mon premier message, dites-moi si ce que j'ai fait est juste.
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Mon Nov 14, 2005 5:41 pm    Post subject: Reply with quote

Mais apparament Widan a raison: le s doit y être je l'ai rajouté ;)
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Mon Nov 14, 2005 5:44 pm    Post subject: Reply with quote

Au fait, ça sert à quoi ce flag? :roll:
Back to top
View user's profile Send private message
kopp
Advocate
Advocate


Joined: 09 Apr 2004
Posts: 2885
Location: Grenoble, France

PostPosted: Mon Nov 14, 2005 5:47 pm    Post subject: Reply with quote

man gcc wrote:
-fvisibility-inlines-hidden
Causes all inlined methods to be marked with "__attribute__ ((visi‐
bility ("hidden")))" so that they do not appear in the export table
of a DSO and do not require a PLT indirection when used within the
DSO. Enabling this option can have a dramatic effect on load and
link times of a DSO as it massively reduces the size of the dynamic
export table when the library makes heavy use of templates. While
it can cause bloating through duplication of code within each DSO
where it is used, often the wastage is less than the considerable
space occupied by a long symbol name in the export table which is
typical when using templates and namespaces. For even more savings,
combine with the "-fvisibility=hidden" switch.


Au fait, tu peux éditer des message tu sais, plutot qu'en mettre 4 à la suite en 1/4h

EDIT : en fait je sais pas si c'est très clair... en gros tu dois gagner du temps au linkage et sur la charge... Appel aux gurus du C :)
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Mon Nov 14, 2005 5:51 pm    Post subject: Reply with quote

kopp wrote:
man gcc wrote:
-fvisibility-inlines-hidden
Causes all inlined methods to be marked with "__attribute__ ((visi‐
bility ("hidden")))" so that they do not appear in the export table
of a DSO and do not require a PLT indirection when used within the
DSO. Enabling this option can have a dramatic effect on load and
link times of a DSO as it massively reduces the size of the dynamic
export table when the library makes heavy use of templates. While
it can cause bloating through duplication of code within each DSO
where it is used, often the wastage is less than the considerable
space occupied by a long symbol name in the export table which is
typical when using templates and namespaces. For even more savings,
combine with the "-fvisibility=hidden" switch.
Je n'y comprends absolument rien :( (habitué: sous Linux, toujours comme ça. J'essaye cependant rester toujours coté utilisateur, sionon ça prend vachement du temps, la maintenance du système!)
kopp wrote:
Au fait, tu peux éditer des message tu sais, plutot qu'en mettre 4 à la suite en 1/4h
J'allais le faire! Maintenant après ton post ce n'est plus possible :? (Ok je reconnais que c'est de ma faute, pas bien grave, excusez).
Back to top
View user's profile Send private message
widan
Veteran
Veteran


Joined: 07 Jun 2005
Posts: 1512
Location: Paris, France

PostPosted: Mon Nov 14, 2005 7:00 pm    Post subject: Reply with quote

digimag wrote:
Je n'y comprends absolument rien :( (habitué: sous Linux, toujours comme ça. J'essaye cependant rester toujours coté utilisateur, sionon ça prend vachement du temps, la maintenance du système!)

En C++, on peut spécifier qu'une méthode est "inline", c'est-à-dire que le compilateur va directement intégrer le code de la méthode dans la fonction appelante, plutôt que de créer un appel de fonction (ça éviter le coût d'un appel de fonction pour des méthodes courtes, comme les accesseurs par ex.). Le flag "-fvisibility-inlines-hidden" dit au compilateur de ne pas exporter ces méthodes quand on crée une lib dynamique (elles n'ont pas vraiment de raison d'être exportées, puisqu'elles ne sont jamais appelées: elles sont toujours inlinées).

Le résultat est que la table des fonctions exportées est beaucoup plus petite, donc la lib est plus petite, et il y a moins de boulot pour le linker dynamique ld.so quand il faut la charger, donc c'est un peu plus rapide.
Back to top
View user's profile Send private message
bong
Apprentice
Apprentice


Joined: 26 Oct 2004
Posts: 276
Location: Brest / Metz

PostPosted: Mon Nov 14, 2005 7:02 pm    Post subject: Reply with quote

J'aurai plutot mis ça dans les CXXFLAGS... je crois pas qu'un compilo C comprenne ce qu'est une fonction "inline"...

Edit: je confirme (vieux cours de C++ exhumé):

En C:
Code:
#define ABS(x) ((x) > 0 ? (x) : -(x))
x = sqrt(ABS(y));


En C++
Code:
inline double ABS(double x){
        return(x > 0 ? x : -x);
}
x = sqrt(ABS(y));
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Tue Nov 15, 2005 11:49 am    Post subject: Reply with quote

D'accord, merci beaucoup à vous :)
Donc l'erreur venait bien du fait que le compilateur C ne gére pas la proprieté en question ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum