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  <ludo...@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.
+

Reply via email to