--- a/src/gcc/ada/s-osinte-kfreebsd-gnu.ads	2009-11-23 15:56:58.000000000 +0100
+++ a/src/gcc/ada/s-osinte-kfreebsd-gnu.ads	2011-07-25 23:00:01.000000000 +0200
@@ -314,6 +314,12 @@ package System.OS_Interface is
       oset : access sigset_t) return int;
    pragma Import (C, pthread_sigmask, "pthread_sigmask");
 
+   function lwp_self return System.Address;
+   --  lwp_self does not exist on this thread library, revert to pthread_self
+   --  which is the closest approximation (with getpid). This function is
+   --  needed to share 7staprop.adb across POSIX-like targets.
+   pragma Import (C, lwp_self, "pthread_self");
+
    --------------------------
    -- POSIX.1c  Section 11 --
    --------------------------
@@ -471,6 +477,16 @@ package System.OS_Interface is
       cpuset     : access cpu_set_t) return int;
    pragma Import (C, pthread_setaffinity_np, "__gnat_pthread_setaffinity_np");
 
+   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
 
    type sigset_t is array (1 .. 4) of unsigned;
