other/7535: GCC configuration problem: failed to correctly detect hidden attribute support

grigory@stl.sarov.ru grigory@stl.sarov.ru
Thu Aug 8 00:06:00 GMT 2002


>Number:         7535
>Category:       other
>Synopsis:       GCC configuration problem: failed to correctly detect hidden attribute support
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 08 00:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Grigory Zagorodnev
>Release:        3.1.1
>Organization:
>Environment:
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
Configured with: ./configure --prefix=/usr/local --program-suffix=-3.1.1 --enable-threads
Thread model: posix
gcc version 3.1.1
>Description:
The issuue
----------
G++ 3.1.1 compiler configuration script failed to detect assembler's hidden attribute support. However, the 'as' installed on my box actually does support this feature. So, we should consider this bahaviour as erroneous.

Config command line is:
	./configure --prefix=/usr/local --program-suffix=-3.1.1 --enable-threads 

Config output:
	...
	checking assembler hidden support... no
	...


Environment
-----------
The environment is:
	ia-32 Red Hat Linux 7.1
	GNU assembler version 2.10.91 (i386-redhat-linux) using BFD version 2.10.91.0.2

Further investigation showed that configure script fails either on ia-32 Red Hat 7.2 and 7.3. Where higher versions of binutils are used.
	GNU assembler version 2.11.93.0.2 (i386-redhat-linux) using BFD version 2.11.93.0.2 20020207


The impact
----------
According to the C++ ABI, __cxa_atexit/__cxa_finalize should be used to perform file-scope C++ objects destruction. Both these routines uses special identifier __dso_handle which should has unique value for each loadable module within the process. 

That requires __dso_handle be local for each particular SO or executable. Attribute hidden should be used to make it local. 

However, wrongly detected hidden attribute feature support, makes impossible to use C++ ABI conformant object destruction mechanism, since __dso_handle becomes visible outside the loadable module.

See declaration of __dso_handle in file "gcc/crtstuff.c":
	#ifdef HAVE_GAS_HIDDEN
	asm (".hidden\t__dso_handle");
	#endif

	#ifdef CRTSTUFFS_O
	void *__dso_handle = &__dso_handle;
	...

Note that C++ ABI conformant destruction mechanism is not enabled in the compiler by default yet. Special option -fuse-cxa-atexit turns this on.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list