[PATCH] Build libgcc_s on Windows

Paolo Bonzini bonzini@gnu.org
Tue Aug 19 16:17:00 GMT 2008


Aaron W. LaFramboise wrote:
> Paolo Bonzini wrote:
> 
>> +  if (pe_dll) {
>> +    # This matches SHLIB_SONAME in config/i386/t-cygming.
>> +    print "LIBRARY " pe_dll;
>> +    print "EXPORTS";
>> +  }
>>
>> so that in the future it will suffice to have Windows maintainer 
>> approval if you change the soname.
> 
> I actually tried this, but this doesn't work, because at the time mkmap 
> is run, the base soname has not yet been substituted, so you end up with 
> @something@_1.dll or something.  Maybe I'll think of a more creative way 
> to do this so its not duplicated.

Right.  I guess your patch is then okay from this build maintainer.

Howeever, if you want to do this cleanup, it's easy enough: in 
libgcc/Makefile.in you should change $(SHLIB_MKMAP_OPTS) to $(subst 
@shlib_base_name@,libgcc_s,$(SHLIB_MKMAP_OPTS)).

Bonus points if you change all the occurrences of

$(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \
                 @multilib_dir@,$(MULTIDIR),$(subst \
                 @shlib_objs@,$(objects),$(subst \
                 @shlib_base_name@,SOME_BASE_NAME,$(subst \
                 @shlib_map_file@,$(mapfile),$(subst \
                 @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
                 @shlib_slibdir@,$(shlib_slibdir),$(SOME_VAR))))))))

to something like

	$(call replace_shlib_vars,SOME_BASE_NAME,$(SOME_VAR))

using an auxiliary variable definition like this one:

replace_shlib_vars = $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \
                 @multilib_dir@,$(MULTIDIR),$(subst \
                 @shlib_objs@,$(objects),$(subst \
                 @shlib_base_name@,$(1),$(subst \
                 @shlib_map_file@,$(mapfile),$(subst \
                 @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
                 @shlib_slibdir@,$(shlib_slibdir),$(2))))))))

Thanks in advance, :-P

Paolo



More information about the Gcc-patches mailing list