This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 64bit] Fix speclib for x86_64
- From: Yaakov (Cygwin/X) <yselkowitz at users dot sourceforge dot net>
- To: cygwin-patches at cygwin dot com
- Date: Sun, 17 Feb 2013 04:46:22 -0600
- Subject: [PATCH 64bit] Fix speclib for x86_64
2013-02-16 Yaakov Selkowitz <yselkowitz@...>
* Makefile.in (libcygwin.a): Move --target flag from here...
(toolopts): to here, to be used by both mkimport and speclib.
* speclib: Omit leading underscore in symbol names on x86_64.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/Makefile.in,v
retrieving revision 1.257.2.14
diff -u -p -r1.257.2.14 Makefile.in
--- Makefile.in 15 Feb 2013 13:36:35 -0000 1.257.2.14
+++ Makefile.in 17 Feb 2013 05:15:10 -0000
@@ -123,7 +123,7 @@ LIBGMON_A:=libgmon.a
CYGWIN_START:=crt0.o
GMON_START:=gcrt0.o
-toolopts:=--ar=${AR} --as=${AS} --nm=${NM} --objcopy=${OBJCOPY}
+toolopts:=--target=${target_alias} --ar=${AR} --as=${AS} --nm=${NM} --objcopy=${OBJCOPY}
speclib=\
${srcdir}/speclib ${toolopts} \
--exclude='cygwin' \
@@ -434,7 +434,7 @@ $(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg
# Rule to build libcygwin.a
$(LIB_NAME): $(LIBCOS) | $(TEST_DLL_NAME)
- ${srcdir}/mkimport --target=$(target_alias) ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $^
+ ${srcdir}/mkimport ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $^
${STATIC_LIB_NAME}: mkstatic ${TEST_DLL_NAME}
perl -d $< -x ${EXCLUDE_STATIC_OFILES} --library=${LIBC} --library=${LIBM} --ar=${AR} $@ cygwin.map
Index: speclib
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/speclib,v
retrieving revision 1.25
diff -u -p -r1.25 speclib
--- speclib 11 Feb 2011 18:00:55 -0000 1.25
+++ speclib 17 Feb 2013 05:15:10 -0000
@@ -11,16 +11,17 @@ my $static;
my $inverse;
my @exclude;
-my ($ar, $as, $nm, $objcopy);
+my ($target, $ar, $as, $nm, $objcopy);
GetOptions('exclude=s'=>\@exclude, 'static!'=>\$static, 'v!'=>\$inverse,
- 'ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy);
+ 'target=s'=>\$target, 'ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy);
$_ = File::Spec->rel2abs($_) for @ARGV;
my $libdll = shift;
my $lib = pop;
+my $uscore = ($target =~ /^x86_64\-/ ? undef : '_');
(my $iname = basename $lib) =~ s/\.a$//o;
-$iname = '_' . $iname . '_dll_iname';
+$iname = $uscore . $iname . '_dll_iname';
open my $nm_fd, '-|', $nm, '-Apg', '--defined-only', @ARGV, $libdll or
die "$0: execution of $nm for object files failed - $!\n";
@@ -34,7 +35,7 @@ $exclude_regex = qr/$exclude_regex/;
my $dllname;
while (<$nm_fd>) {
study;
- if (/ I _(.*)_dll_iname/o) {
+ if (/ I _?(.*)_dll_iname/o) {
$dllname = $1;
} else {
my ($file, $member, $symbol) = m%^([^:]*):([^:]*(?=:))?.* T (.*)%o;