[commit: packages/unix] master: Android doesn’t have telldir/seekdir in bionic (540a317)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 22:04:57 UTC 2017


Repository : ssh://git@git.haskell.org/unix

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/540a317a212ecef8592cc8089ecce1dacea08b2b/unix

>---------------------------------------------------------------

commit 540a317a212ecef8592cc8089ecce1dacea08b2b
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Mon Mar 20 09:26:04 2017 +0800

    Android doesn’t have telldir/seekdir in bionic
    
    The isse here is that while we try to use `AC_CHECK_FUNCS`, this will generate test code
    that tries to link an object and check for linking errors.  However  GNU gold at least version
    (binutils-2.25-0666073 2.25.51.20141117) 1.11, considers seekdir/telldir as part of the
    default libs. Thus we would actually want to pass `-nodefaultlibs` to the linker. Doing so,
    would result in erros due to not finding `-ldl`.
    
    Fixes #91


>---------------------------------------------------------------

540a317a212ecef8592cc8089ecce1dacea08b2b
 configure.ac | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index fdc27e4..32f7174 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,8 +37,10 @@ AC_CHECK_FUNCS([nanosleep])
 AC_CHECK_FUNCS([ptsname])
 AC_CHECK_FUNCS([setitimer])
 AC_CHECK_FUNCS([readdir_r])
+
 dnl not available on android so check for it
-AC_CHECK_FUNCS([telldir seekdir])
+AC_CANONICAL_TARGET
+AS_CASE([$target_os],[*-android*],[],[AC_CHECK_FUNCS([telldir seekdir])])
 
 dnl When available, _NSGetEnviron() (defined in <crt_externs.h>) is
 dnl the preferred way to access environ(7)



More information about the ghc-commits mailing list