[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static
From: |
Charles Wilson |
Subject: |
Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static |
Date: |
Fri, 14 Nov 2008 02:41:29 -0500 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666 |
Ralf Wildenhues wrote:
>> The point is, we perhaps STARTED with the .la file, but the whole point
>> of the dlpreopen $pass is to replace each .la file in $dlprefiles with
>> the name of the object from which the symbols should be extracted, to
>> build the symbol table. So, pick one: either the DLL, or the import
>> library (there is no static lib, the failure mode in question occurs
>> when --disable-static).
>>
>> If you pick "DLL" -- then it's real hard to get the symbols (objdump
>> ugliness, plus figuring out which ones are DATA).
>>
>> If you pick "implib" -- then it's real hard to get the correct DLL name
>> (but not nearly as hard as extracting the correct symbols from the dll).
>>
>> But the name of the .la file is no longer available.
>
> But that's a problem that can be solved.
>
> # turn $1 into a string suitable for a shell variable name
> func_tr_sh ()
> {
> ... # typically forks, except maybe with bash ${var/subst/repl}
> }
>
> # when treating $dlprefile, save the corresponding .la file name:
> func_tr_sh "$dlprefile"
> eval "libfile_$tr_sh_result=\$corresponding_dotla_file"
>
> # later, when searching for the .la file, test libfile$tr_sh_result
> # for contents
>
> What do you think?
That would work. But it only gets rid of the grotty "find the name of
the DLL given the implib" problem -- which is not a small thing, of course.
But that presupposes that my change to the dlpreopen $pass, where on
cygwin|mingw we replace the la file in the $dlprefiles list with the
implib, stands. Did I convince you we needed this bit:
- elif test -n "$dlname"; then
- newdlprefiles="$newdlprefiles $dir/$dlname"
+ # Except on mingw|cygwin, where we must use the import library,
+ # so lt_dlopen is handled in another way
else
- newdlprefiles="$newdlprefiles $dir/$linklib"
+ case "$host" in
+ *cygwin* | *mingw* )
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ ;;
+ * )
+ if test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ ;;
+ esac
If so, then I guess the other code section would look like
func_verbose "extracting global C symbols from \`$dlprefile'"
func_basename "$dlprefile"
name="$func_basename_result"
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
+ case $host in
+ *cygwin | *mingw* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$tr_sh_result"
+ $opt_dry_run || {
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # geez. does this need to happen in a subshell, to
+ # avoid clobbering our current variable values?
+ source "$curr_lafile"
+ if test -n "$dlname" ; then
+ func_basename "$dlname"
+ dlbasename="$func_basename_result"
+ eval '$ECHO ": $dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ else
+ func_warning "Could not determing .la name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >>
'$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >>
'$nlist'"
+ }
+ fi
+ ;;
+ *)
etc.
Is that the idea?
--
Chuck
- [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Charles Wilson, 2008/11/08
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Ralf Wildenhues, 2008/11/12
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Charles Wilson, 2008/11/13
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Ralf Wildenhues, 2008/11/13
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Brian Dessent, 2008/11/13
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Ralf Wildenhues, 2008/11/24
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Brian Dessent, 2008/11/24
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Charles Wilson, 2008/11/24
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, libtool, 2008/11/13
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Ralf Wildenhues, 2008/11/14
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static,
Charles Wilson <=
- Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static, Charles Wilson, 2008/11/15