* PR ada/49944 [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with "s-taprop.adb:856:10: "pthread_attr_setaffinity_np" is undefined (more references follow)"
@ 2011-08-02 17:36 Ludovic Brenta
0 siblings, 0 replies; only message in thread
From: Ludovic Brenta @ 2011-08-02 17:36 UTC (permalink / raw)
To: gcc-patches
I think the following patch fixes this problem; it consists only in
copying a few lines from s-osinte-linux.ads to
s-osinte-kfreebsd-gnu.ads:
Index: b/src/gcc/ada/s-osinte-kfreebsd-gnu.ads
===================================================================
--- a/src/gcc/ada/s-osinte-kfreebsd-gnu.ads
+++ b/src/gcc/ada/s-osinte-kfreebsd-gnu.ads
@@ -469,7 +479,20 @@
(thread : pthread_t;
cpusetsize : size_t;
cpuset : access cpu_set_t) return int;
- pragma Import (C, pthread_setaffinity_np, "__gnat_pthread_setaffinity_np");
+ pragma Import (C, pthread_setaffinity_np, "pthread_setaffinity_np");
+ pragma Weak_External (pthread_setaffinity_np);
+ -- Use a weak symbol because this function may be available or not,
+ -- depending on the version of the system.
+
+ function pthread_attr_setaffinity_np
+ (attr : access pthread_attr_t;
+ cpusetsize : size_t;
+ cpuset : access cpu_set_t) return int;
+ pragma Import (C, pthread_attr_setaffinity_np,
+ "pthread_attr_setaffinity_np");
+ pragma Weak_External (pthread_attr_setaffinity_np);
+ -- Use a weak symbol because this function may be available or not,
+ -- depending on the version of the system.
private
Index: b/src/gcc/ada/ChangeLog
===================================================================
--- a/src/gcc/ada/ChangeLog
+++ b/src/gcc/ada/ChangeLog
@@ -0,0 +1,15 @@
+2011-08-02 Ludovic Brenta <ludovic@ludovic-brenta.org>
+
+ PR ada/49944
+ * s-osinte-kfreebsd-gnu.ads (pthread_setaffinity_np): import
+ pthread_setaffinity_np instead of __gnat_pthread_setaffinity_np,
+ which no longer exists; and use a Weak_External reference, like we
+ do on Linux.
+ (pthread_attr_setaffinity_np): new, copy from s-osinte-linux.ads.
+
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-08-02 17:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-02 17:36 PR ada/49944 [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with "s-taprop.adb:856:10: "pthread_attr_setaffinity_np" is undefined (more references follow)" Ludovic Brenta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).