Bug 345

Summary: libcurl package needs a urandom fix
Product: buildroot Reporter: Gustavo Zacarias <gustavo>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: buildroot
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: i686-linux Target: arm-softfloat-linux-uclibcgnueabi
Build:
Attachments: Fix libcurl's urandom needs
My buildroot .config

Description Gustavo Zacarias 2009-05-22 13:21:09 UTC
Created attachment 343 [details]
Fix libcurl's urandom needs

Doing a huge test-build for 2009.05-rc2 i've found that the libcurl package only specifies the random (/dev/urandom) device to configure when building against openssl.
But it requires this when building in general so the patch specifies the random device always instead of conditionally, otherwise the build breaks with the dreaded "can't determine random device when cross compiling".
Comment 1 Peter Korsgaard 2009-05-22 20:15:31 UTC
Really? From a quick look at configure.ac I see:

if test X"$OPENSSL_ENABLED" = X"1"; then
  dnl Check for user-specified random device
  AC_ARG_WITH(random,
  AC_HELP_STRING([--with-random=FILE],
                 [read randomness from FILE (default=/dev/urandom)]),

With what config were you seeing this problem?
Comment 2 Gustavo Zacarias 2009-05-22 20:20:35 UTC
Sure, but you're not EAUTORECONFing :)
So configure says:

                    { echo "$as_me:$LINENO: checking for \"/dev/urandom\"" >&5
echo $ECHO_N "checking for \"/dev/urandom\"... $ECHO_C" >&6; }
if test "${ac_cv_file___dev_urandom_+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  test "$cross_compiling" = yes &&
  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
   { (exit 1); exit 1; }; }
if test -r ""/dev/urandom""; then
  ac_cv_file___dev_urandom_=yes
else
  ac_cv_file___dev_urandom_=no
fi

Which wants it when cross-compiling no matter what...
Comment 3 Peter Korsgaard 2009-05-23 06:53:47 UTC
No, we're not autoreconfing, but configure is generated from configure.ac upstream, so the logic you see in configure.ac will be present in configure as well.

I just did a test build and I still cannot reproduce it:

BR2_arm=y
BR2_arm922t=y
BR2_ARM_TYPE="ARM922T"
BR2_ARM_OABI=y
BR2_ARCH="arm"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_TUNE="arm922t"
BR2_GCC_TARGET_ARCH="armv4t"
BR2_GCC_TARGET_ABI="apcs-gnu"
BR2_BINUTILS_VERSION_2_19_1=y
BR2_BINUTILS_VERSION="2.19.1"
BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
BR2_GCC_VERSION_4_3_3=y
BR2_GCC_SUPPORTS_SYSROOT=y
BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE=y
BR2_GCC_VERSION="4.3.3"
BR2_TOOLCHAIN_SYSROOT=y
BR2_EXTRA_GCC_CONFIG_OPTIONS=""
BR2_GCC_SHARED_LIBGCC=y
BR2_PTHREADS_OLD=y
BR2_PACKAGE_LIBCURL=y

grep urandom build_arm/libcurl-7.19.2/config.log

Are you sure configure doesn't think you have openssl installed? (On my system I do have libssl-dev installed on the host, but configure doesn't pick it up)

Now, you could argue for adding --without-ssl to configure when we compile without openssl support instead of relying on the autodection to not find anything.
Comment 4 Gustavo Zacarias 2009-05-26 17:10:49 UTC
Created attachment 355 [details]
My buildroot .config

Actually openssl IS installed, just not in the .config
It seems it's being pulled in by something else in a bad way, probably x11r7-related.
Any (easy) way to trace this?
Comment 5 Gustavo Zacarias 2009-05-26 17:52:04 UTC
If BR2_PACKAGE_XSERVER_tinyx is defined (but not BR2_PACKAGE_XSERVER_XORG_SERVER) it stills pulls in openssl in package/x11r7/xserver_xorg-server/xserver_xorg-server.mk but it doesn't select it in package/x11r7/xserver_xorg-server/Config.in
It should probably be depended upon in the .mk file only if xorg biggie is selected.
Comment 6 Peter Korsgaard 2009-05-27 18:23:47 UTC
Seems like bugzilla threw away my previous comment :/

Anyway, the real problem is way the X packages are structured. It should be possible to compile X applications without having an X server on the target (and just xlib), but that's currently not the case. The problem you ran into is that packages depend on !BR_PACKAGE_XSERVER_none in kconfig, but use $(XSERVER) as the make dependency, and you can enable BR2_PACKAGE_XSERVER_{tinyx,xorg} without enabling an Xserver.

I'll work on cleaning this up post-2009.05 release, but for now I simply fixed libcurl to not look for openssl if it's not enabled in kconfig.