diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 5d4966be295..5938798cef0 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -1780,7 +1780,7 @@ def process_shlibs(pkgfiles, d):
                     darwin_so(file, needed, sonames, pkgver)
                 elif hostos.startswith("mingw"):
                     mingw_dll(file, needed, sonames, pkgver)
-                elif os.access(file, os.X_OK) or lib_re.match(file):
+                elif cpath.is_executable(file) or lib_re.match(file):
                     linuxlist.append(file)
 
         if linuxlist:
