Discussion:
weakref [Was: [Pcc-commit] CVS commit: pcc/arch/amd64]
Antoine Leca
2014-04-14 14:41:04 UTC
Permalink
Hi,

Sorry to not have spotted it earlier :-(
But there is something I am uncomfortable with:

Anders Magnusson wrote on March 20th
List: pcc-commit-list
Subject: [Pcc-commit] CVS commit: pcc/arch/amd64
Date: 2014-03-20 18:45:36
Message-ID: 20140320184536.CB1918443 () pcc ! ludd ! ltu ! se
Module Name: pcc
Committed By: ragge
Date: Thu Mar 20 18:45:36 UTC 2014
pcc/arch/amd64: local.c macdefs.h
WEAKREF is understood by modern assemblers.
cvs rdiff -u -r1.76 -r1.77 pcc/arch/amd64/local.c
cvs rdiff -u -r1.27 -r1.28 pcc/arch/amd64/macdefs.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
: Here is the diffs:

Index: pcc/arch/amd64/macdefs.h
diff -u pcc/arch/amd64/macdefs.h:1.27 pcc/arch/amd64/macdefs.h:1.28
--- pcc/arch/amd64/macdefs.h:1.27 Fri Dec 28 17:02:49 2012
+++ pcc/arch/amd64/macdefs.h Thu Mar 20 19:45:36 2014
@@ -1,4 +1,4 @@
-/* $Id: macdefs.h,v 1.27 2012/12/28 16:02:49 ragge Exp $ */
+/* $Id: macdefs.h,v 1.28 2014/03/20 18:45:36 ragge Exp $ */
/*
* Copyright (c) 2008 Michael Shalayeff
* Copyright (c) 2003 Anders Magnusson (***@ludd.luth.se).
@@ -258,6 +258,7 @@
#define XASM_NUMCONV(ip, p, q) numconv(ip, p, q)
#define XASMCONSTREGS(x) xasmconstregs(x)

+#define HAVE_WEAKREF
/*
* builtins.
*/
----------------------------

I was thinking this really should be detected by some autoconf
machinery, shouldn't it?

The real complexity is probably _how_ to successfully detect it...
(after having established what is the as to use, successfully invoked it
--which we are not doing at the moment IIUC, etc.)

Or is it a feature which is really required (at least for ELF/amd64) for
pcc to work correctly, at least right now?


Antoine
Anders Magnusson
2014-04-14 17:27:52 UTC
Permalink
Hi Antoine,
Post by Antoine Leca
Hi,
Sorry to not have spotted it earlier :-(
Anders Magnusson wrote on March 20th
List: pcc-commit-list
Subject: [Pcc-commit] CVS commit: pcc/arch/amd64
Date: 2014-03-20 18:45:36
Message-ID: 20140320184536.CB1918443 () pcc ! ludd ! ltu ! se
Module Name: pcc
Committed By: ragge
Date: Thu Mar 20 18:45:36 UTC 2014
pcc/arch/amd64: local.c macdefs.h
WEAKREF is understood by modern assemblers.
cvs rdiff -u -r1.76 -r1.77 pcc/arch/amd64/local.c
cvs rdiff -u -r1.27 -r1.28 pcc/arch/amd64/macdefs.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Index: pcc/arch/amd64/macdefs.h
diff -u pcc/arch/amd64/macdefs.h:1.27 pcc/arch/amd64/macdefs.h:1.28
--- pcc/arch/amd64/macdefs.h:1.27 Fri Dec 28 17:02:49 2012
+++ pcc/arch/amd64/macdefs.h Thu Mar 20 19:45:36 2014
@@ -1,4 +1,4 @@
-/* $Id: macdefs.h,v 1.27 2012/12/28 16:02:49 ragge Exp $ */
+/* $Id: macdefs.h,v 1.28 2014/03/20 18:45:36 ragge Exp $ */
/*
* Copyright (c) 2008 Michael Shalayeff
@@ -258,6 +258,7 @@
#define XASM_NUMCONV(ip, p, q) numconv(ip, p, q)
#define XASMCONSTREGS(x) xasmconstregs(x)
+#define HAVE_WEAKREF
/*
* builtins.
*/
----------------------------
I was thinking this really should be detected by some autoconf
machinery, shouldn't it?
The real complexity is probably _how_ to successfully detect it...
(after having established what is the as to use, successfully invoked it
--which we are not doing at the moment IIUC, etc.)
Or is it a feature which is really required (at least for ELF/amd64) for
pcc to work correctly, at least right now?
Weakref is something that most (all?) amd64 ELF OSes use, and expects it
to exist.
That is also true with current gas (since quite some years ago). I
added it in a
somewhat awkward way to amd64, it should be target-independent. But not
yet.

Maybe it should be detected by autoconf, but that may open another can
of worms.

Feel welcome with a better solution.

-- Ragge

Loading...