[llvm-commits] [patch][cmake] More config.h.cmake fixes.

Óscar Fuentes ofv at wanadoo.es
Mon Jan 17 08:41:23 PST 2011


Óscar Fuentes <ofv at wanadoo.es> writes:

> arrowdodger arrowdodger <6yearold at gmail.com> writes:
>
>> Some more easy stuff in config-ix.cmake and cmake.config.h.
>> Bonus: two typos in Makefiles.
>
> [snip]
>
>> +if( HAVE_DLFCN_H )
>> +  check_symbol_exists(dlerror dlfcn.h HAVE_DLERROR)
>> +  check_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
>> +endif()
>
> There is something odd with this:
>
> -- Looking for dlerror
> -- Looking for dlerror - not found.
> -- Looking for dlopen
> -- Looking for dlopen - not found.
>
> I'm on Linux 2.6.35-24-generic #42-Ubuntu SMP x86_64 GNU/Linux, and of
> course dlfcn.h is on /usr/include and it contains dlopen:
>
> extern void *dlopen (__const char *__file, int __mode) __THROW;
>
> The `configure' script detects those functions alright.

Found the problem. The test failed because `dl' was not listed as a
required library. On this cases it is really useful to look at
CMakeFiles/CMakeError.log!

if( HAVE_DLFCN_H AND HAVE_LIBDL )
  list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
  check_symbol_exists(dlerror dlfcn.h HAVE_DLERROR)
  check_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
  list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES dl)
endif()

Committed your patch with the modification listed above.




More information about the llvm-commits mailing list