[Haskell-cafe] How to fix linker error on MacOS

Viktor Dukhovni ietf-dane at dukhovni.org
Sat Jun 26 22:52:43 UTC 2021


from a recent rts/rts.cabal.in:

-- Note [fd_set_overflow]
-- ~~~~~~~~~~~~~~~~~~~~~~
-- In this note is the very sad tale of __darwin_fd_set_overflow.
-- The 8.10.5 release was broken because it was built in an environment
-- where the libraries were provided by XCode 12.*, these libraries introduced
-- a reference to __darwin_fd_set_overflow via the FD_SET macro which is used in
-- Select.c. Unfortunately, this symbol is not available with XCode 11.* which
-- led to a linker error when trying to link anything. This is almost certainly
-- a bug in XCode but we still have to work around it.
      
-- Undefined symbols for architecture x86_64:
--  "___darwin_check_fd_set_overflow", referenced from:
--      _awaitEvent in libHSrts.a(Select.o)
-- ld: symbol(s) not found for architecture x86_64

-- One way to fix this is to upgrade your version of xcode, but this would
-- force the upgrade on users prematurely. Fortunately it also seems safe to pass
-- the linker option "-Wl,-U,___darwin_check_fd_set_overflow" because the usage of
-- the symbol is guarded by a guard to check if it's defined.



> On 26 Jun 2021, at 6:47 pm, David Banas <capn.freako at gmail.com> wrote:
> 
> How do I fix this (from `cabal build`)?
> 
> Undefined symbols for architecture x86_64:
>  "___darwin_check_fd_set_overflow", referenced from:
>      _awaitEvent in libHSrts.a(Select.o)
> 
> System Info:
> =========
> 
> $ ghc --version
> The Glorious Glasgow Haskell Compilation System, version 8.10.5
> 
> $ cabal --version
> cabal-install version 3.4.0.0
> compiled using version 3.4.0.0 of the Cabal library 
> 
> dbanas at Davids-MBP-2:~/Documents/Luminous/Projects/haskarch
> $ sw_vers
> ProductName:    Mac OS X
> ProductVersion: 10.14.6
> BuildVersion:   18G9216

-- 
	Viktor.



More information about the Haskell-Cafe mailing list