Unable to link OpenSSL

Hubert Prechler h at prechler.com
Fri Jan 15 20:48:48 CET 2016


Hi,

we're trying to link OpenSSL via cc_command paramter but it doesn't work. What are we missing?

##
_ at lima /etc/systemd/system # service varnish start
Job for varnish.service failed. See 'systemctl status varnish.service' and 'journalctl -xn' for details.
_ at lima /etc/systemd/system # systemctl status -l varnish.service
● varnish.service - Varnish Cache, a high-performance HTTP accelerator
    Loaded: loaded (/etc/systemd/system/varnish.service; disabled)
    Active: failed (Result: exit-code) since Fri 2016-01-15 16:26:31 CET; 14s ago
   Process: 17994 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/magento.vcl 
-S /etc/varnish/secret -p feature=+esi_disable_xml_check,+esi_ignore_other_elements -p 
vsl_reclen=4084 -p vcc_allow_inline_c=on -p cc_command=exec cc -fpic -shared -Wl,-x -o %o %s 
-lcrypto -lssl -s malloc,5G (code=exited, status=2)

Jan 15 16:26:31 lima varnishd[17994]: /usr/bin/ld: warning: Cannot create .eh_frame_hdr section, 
--eh-frame-hdr ignored.
Jan 15 16:26:31 lima varnishd[17994]: /usr/bin/ld: error in /bin/sh(.eh_frame); no .eh_frame_hdr 
table will be created.
Jan 15 16:26:31 lima varnishd[17994]: Message from dlopen:
Jan 15 16:26:31 lima varnishd[17994]: Could not load compiled VCL.
Jan 15 16:26:31 lima varnishd[17994]: dlopen(vcl_boot/vgc.so) = vcl_boot/vgc.so: symbol lxstat, 
version GLIBC_2.2.5 not defined in file libc.so.6 with link time reference
Jan 15 16:26:31 lima varnishd[17994]: Running dlopen failed, exited with 1
Jan 15 16:26:31 lima varnishd[17994]: VCL compilation failed
Jan 15 16:26:31 lima systemd[1]: varnish.service: control process exited, code=exited status=2
Jan 15 16:26:31 lima systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Jan 15 16:26:31 lima systemd[1]: Unit varnish.service entered failed state.


##
_ at lima /etc/systemd/system # varnishd -V
varnishd (varnish-4.1.0 revision 3041728)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2015 Varnish Software AS
_ at lima /etc/systemd/system # uname -a
Linux lima 3.16.0-4-amd64 # 1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02) x86_64 GNU/Linux
_ at lima /etc/systemd/system # dpkg -s libc6 | grep ^Version
Version: 2.19-18+deb8u1
_ at lima /etc/systemd/system # dpkg -s openssl | grep ^Version
Version: 1.0.1k-3+deb8u2
_ at lima /etc/systemd/system # dpkg -s libssl-dev | grep ^Version
Version: 1.0.1k-3+deb8u2


## VCL inline snippet:
C{
     #include <string.h>
     #include <stdio.h>
     #include <stdlib.h>
     #include <openssl/md5.h>

     /**
      * create md5 hash of string and return it
      */
     char *generate_formkey(char *string) {
         // generate md5
         unsigned char result[MD5_DIGEST_LENGTH];
         MD5((const unsigned char *)string, strlen(string), result);

         // convert to chars
         static char md5string[MD5_DIGEST_LENGTH + 1];
         const char *hex = "0123456789ABCDEF";
         unsigned char *pin = result;
         char *pout = md5string;

         for(; pin < result + sizeof(result); pout+=2, pin++) {
             pout[0] = hex[(*pin>>4) & 0xF];
             pout[1] = hex[ *pin     & 0xF];
         }
         pout[-1] = 0;

      // return md5
         return md5string;
     }
}C

Thank you,
Hubert



More information about the varnish-misc mailing list