- respect CC (vsftpd-ext) - respect CFLAGS[1], don't append -O2 as it breaks WITH_DEBUG/DEBUG_FLAGS/CFLAGS set in make.conf/Makefile.local - don't strip unconditionally, rely INSTALL_PROGRAM respecting STRIP[2] - remove -lwrap from LDFLAGS, rely on vsf_findlibs.sh adding it - don't link against -lutil on FreeBSD, setproctitle() moved to libc more than 10 years ago, ports/ do not support FreeBSD < 7. - unbreak ssl build by linking against -lssl (vsftpd-ext) [1] superset of ports/163548 [2] apart from gdb it's also needed in case of system-wide profiling with pmcstat/dtrace How-To-Repeat: # either vsftpd or vsftpd-ext $ make install WITH_DEBUG= $ command gdb -q /usr/local/libexec/vsftpd (no debugging symbols found)...(gdb) # vsftpd-ext $ printf 'CC=clang\nCXX=clang++\nCPP=clang -E\n' >Makefile.local $ __MAKE_CONF= make gcc -c main.c -O2 -pipe -fno-strict-aliasing -O2 -pipe -march=prescott -fno-strict-aliasing -O2 -Wall -W -Wshadow -idirafter dummyinc *** [main.o] Error code 1 # vsfptd-ext + VSFTPD_SSL option $ make ===> Building for vsftpd-ext-ssl-2.3.4.2 [...] gcc -c ssl.c -O2 -pipe -fno-strict-aliasing -I/usr/include -O2 -pipe -fno-strict-aliasing -O2 -Wall -W -Wshadow -idirafter dummyinc [...] gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o ascii.o oneprocess.o twoprocess.o privops.o standalone.o hash.o tcpwrap.o ipaddrparse.o access.o features.o readwrite.o opts.o ssl.o sslslave.o ptracesandbox.o ftppolicy.o sysutil.o sysdeputil.o charconv.o pasvrules.o usersip.o http.o http_msg.o http_str.o -Wl,-s -lpam -lwrap -L/usr/lib ssl.o: In function `ssl_init': WRKSRC/ssl.c:62: undefined reference to `SSL_library_init' WRKSRC/ssl.c:63: undefined reference to `SSLv23_server_method' WRKSRC/ssl.c:63: undefined reference to `SSL_CTX_new' WRKSRC/ssl.c:81: undefined reference to `SSL_CTX_ctrl' WRKSRC/ssl.c:89: undefined reference to `SSL_CTX_use_certificate_chain_file' WRKSRC/ssl.c:93: undefined reference to `SSL_CTX_use_PrivateKey_file' WRKSRC/ssl.c:105: undefined reference to `SSL_CTX_use_certificate_chain_file' WRKSRC/ssl.c:109: undefined reference to `SSL_CTX_use_PrivateKey_file' WRKSRC/ssl.c:115: undefined reference to `SSL_CTX_set_cipher_list' WRKSRC/ssl.c:119: undefined reference to `RAND_status' WRKSRC/ssl.c:133: undefined reference to `SSL_CTX_set_verify' WRKSRC/ssl.c:137: undefined reference to `SSL_CTX_load_verify_locations' WRKSRC/ssl.c:141: undefined reference to `SSL_load_client_CA_file' WRKSRC/ssl.c:146: undefined reference to `SSL_CTX_set_client_CA_list' WRKSRC/ssl.c:152: undefined reference to `SSL_CTX_set_session_id_context' WRKSRC/ssl.c:157: undefined reference to `SSL_CTX_set_timeout' ssl.o: In function `setup_bio_callbacks': WRKSRC/ssl.c:646: undefined reference to `SSL_get_rbio' WRKSRC/ssl.c:647: undefined reference to `BIO_set_callback' WRKSRC/ssl.c:648: undefined reference to `SSL_get_wbio' WRKSRC/ssl.c:649: undefined reference to `BIO_set_callback' ssl.o: In function `get_ssl_error': WRKSRC/ssl.c:640: undefined reference to `SSL_load_error_strings' WRKSRC/ssl.c:641: undefined reference to `ERR_get_error' WRKSRC/ssl.c:641: undefined reference to `ERR_error_string' ssl.o: In function `ssl_read_common': WRKSRC/ssl.c:268: undefined reference to `SSL_read' WRKSRC/ssl.c:269: undefined reference to `SSL_get_error' WRKSRC/ssl.c:276: undefined reference to `SSL_get_shutdown' WRKSRC/ssl.c:268: undefined reference to `SSL_peek' WRKSRC/ssl.c:269: undefined reference to `SSL_get_error' WRKSRC/ssl.c:276: undefined reference to `SSL_get_shutdown' ssl.o: In function `ssl_write': WRKSRC/ssl.c:296: undefined reference to `SSL_write' WRKSRC/ssl.c:297: undefined reference to `SSL_get_error' ssl.o: In function `ssl_write_str': WRKSRC/ssl.c:308: undefined reference to `SSL_write' ssl.o: In function `ssl_data_close': WRKSRC/ssl.c:392: undefined reference to `SSL_shutdown' WRKSRC/ssl.c:396: undefined reference to `SSL_shutdown' WRKSRC/ssl.c:416: undefined reference to `SSL_free' ssl.o: In function `maybe_log_shutdown_state': WRKSRC/ssl.c:337: undefined reference to `SSL_get_shutdown' ssl.o: In function `get_ssl_error': WRKSRC/ssl.c:640: undefined reference to `SSL_load_error_strings' WRKSRC/ssl.c:641: undefined reference to `ERR_get_error' WRKSRC/ssl.c:641: undefined reference to `ERR_error_string' ssl.o: In function `setup_bio_callbacks': WRKSRC/ssl.c:646: undefined reference to `SSL_get_rbio' WRKSRC/ssl.c:647: undefined reference to `BIO_set_callback' WRKSRC/ssl.c:648: undefined reference to `SSL_get_wbio' WRKSRC/ssl.c:649: undefined reference to `BIO_set_callback' ssl.o: In function `ssl_accept': WRKSRC/ssl.c:442: undefined reference to `SSL_ctrl' ssl.o: In function `get_ssl': WRKSRC/ssl.c:518: undefined reference to `SSL_new' WRKSRC/ssl.c:528: undefined reference to `SSL_set_fd' WRKSRC/ssl.c:535: undefined reference to `SSL_free' WRKSRC/ssl.c:538: undefined reference to `SSL_accept' ssl.o: In function `get_ssl_error': WRKSRC/ssl.c:640: undefined reference to `SSL_load_error_strings' WRKSRC/ssl.c:641: undefined reference to `ERR_get_error' WRKSRC/ssl.c:641: undefined reference to `ERR_error_string' ssl.o: In function `get_ssl': WRKSRC/ssl.c:554: undefined reference to `SSL_get_current_cipher' WRKSRC/ssl.c:554: undefined reference to `SSL_CIPHER_get_version' WRKSRC/ssl.c:556: undefined reference to `SSL_get_current_cipher' WRKSRC/ssl.c:560: undefined reference to `SSL_CIPHER_get_name' WRKSRC/ssl.c:561: undefined reference to `SSL_get_peer_certificate' WRKSRC/ssl.c:562: undefined reference to `SSL_ctrl' WRKSRC/ssl.c:578: undefined reference to `X509_free' ssl.o: In function `ssl_cert_digest': WRKSRC/ssl.c:606: undefined reference to `SSL_get_peer_certificate' WRKSRC/ssl.c:615: undefined reference to `EVP_sha256' WRKSRC/ssl.c:615: undefined reference to `X509_digest' WRKSRC/ssl.c:620: undefined reference to `X509_free' ssl.o: In function `ssl_add_entropy': WRKSRC/ssl.c:689: undefined reference to `RAND_load_file' ssl.o: In function `bio_callback': WRKSRC/ssl.c:665: undefined reference to `BIO_ctrl' gcc: error: linker command failed with exit code 1 (use -v to see invocation) *** [vsftpd] Error code 1
Responsible Changed From-To: freebsd-ports-bugs->dinoex Over to maintainer (via the GNATS Auto Assign Tool)
State Changed From-To: open->feedback Ill take this for vsftpd-ext, leaving vsftpd for maintainer.
scheidell 2011-12-23 19:18:55 UTC FreeBSD ports repository Modified files: ftp/vsftpd-ext Makefile Log: - respect CC/CFLAGS/STRIP on vsftpd-ext PR: ports/163550 Submitted by: Jan Beich <jbeich@tormail.net> Approved by: gelraen.ua@gmail.com (maintainer), gabor(mentor) Revision Changes Path 1.6 +6 -5 ports/ftp/vsftpd-ext/Makefile _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: feedback->analyzed > - respect CC (vsftpd-ext) You patch core vsftpd here too, I do not see any problems with the old code. > - respect CFLAGS[1], don't append -O2 as it breaks > WITH_DEBUG/DEBUG_FLAGS/CFLAGS set in make.conf/Makefile.local I do not see any problems with the old code. make clean BATCH=1 WITH_VSFTPD_SSL=1 all WITH_DEBUG=1 DEBUG_FLAGS="-g -g" Where does -O2 breaks debugging? > - don't strip unconditionally, rely INSTALL_PROGRAM respecting STRIP[2] ok, INSTALL_PROGRAM should be used. > - remove -lwrap from LDFLAGS, rely on vsf_findlibs.sh adding it ok, vsf_findlibs does adding it > - don't link against -lutil on FreeBSD, setproctitle() moved to libc > more than 10 years ago, ports/ do not support FreeBSD < 7. ok
dinoex 2011-12-24 10:51:35 UTC FreeBSD ports repository Modified files: ftp/vsftpd Makefile Log: - remove duplicate -lwrap - drop usage of -lutil - honor INSTALL_PROGRAM PR: 163550 Revision Changes Path 1.49 +2 -2 ports/ftp/vsftpd/Makefile _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
dinoex@FreeBSD.org writes: >> - respect CC (vsftpd-ext) > > You patch core vsftpd here too, > I do not see any problems with the old code. I've tried to keep the diff small between vsftpd and vsftpd-ext. $ diff -up ftp/vsftpd{,-ext}/Makefile > >> - respect CFLAGS[1], don't append -O2 as it breaks >> WITH_DEBUG/DEBUG_FLAGS/CFLAGS set in make.conf/Makefile.local > > I do not see any problems with the old code. > make clean BATCH=1 WITH_VSFTPD_SSL=1 all WITH_DEBUG=1 DEBUG_FLAGS="-g -g" WITH_DEBUG=1 won't work unless the port at least respects STRIP. > Where does -O2 breaks debugging? Try with DEBUG_FLAGS='-O0 -g3', notice how always -O2 overrides it. bsd.port.mk does smth similar by disabling -O* added by sys.mk. Don't you want to debug non-optimized code sometimes? Also, a user may want to override system optimization to -O0, -O1, -O3, -O4 or -Ofast for non-debug build, e.g. to benchmark different optimization levels. ports/ are supposed to be a tool not a policy how to build unless I'm misunderstanding CFLAGS chapter in PH. http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/dads-cflags.html > >> - don't strip unconditionally, rely INSTALL_PROGRAM respecting STRIP[2] > > ok, INSTALL_PROGRAM should be used. As vendor install target is unused, the port has its own do-install target. And INSTALL_PROGRAM is executed too late, the binary is stripped during build.
Author: dinoex Date: Thu Sep 6 14:29:59 2012 New Revision: 303756 URL: http://svn.freebsd.org/changeset/ports/303756 Log: - respect INSTALL_PROGRAM, STRIP and custom optimisations in CFLAGS PR: 163550 Modified: head/ftp/vsftpd/Makefile Modified: head/ftp/vsftpd/Makefile ============================================================================== --- head/ftp/vsftpd/Makefile Thu Sep 6 14:11:07 2012 (r303755) +++ head/ftp/vsftpd/Makefile Thu Sep 6 14:29:59 2012 (r303756) @@ -44,6 +44,11 @@ LDFLAGS+= -L${OPENSSLLIB} EXTRA_PATCHES+= ${FILESDIR}/pidfile.patch .endif +VSFTPD_OPTIMIZED= ${CFLAGS:M-O} +.if defined(CFLAGS) && !empty(VSFTPD_OPTIMIZED) +VSFTPD_NO_OPTIMIZED= -e "s| -O2 ||" +.endif + # BROKEN on FreeBSD with undefined reference to `__stack_chk_fail_local' LDFLAGS+= -lssp_nonshared @@ -58,16 +63,16 @@ do-configure: "s|#undef VSF_BUILD_TCPWRAPPERS|#define VSF_BUILD_TCPWRAPPERS 1|" \ ${WRKSRC}/builddefs.h .endif - ${REINPLACE_CMD} -e "s|^listen=|#listen=|" \ + ${REINPLACE_CMD} -e "s|^listen=.*|listen=NO|" \ -e "s|/etc/vsftpd.conf|${PREFIX}/etc/vsftpd.conf|" \ ${WRKSRC}/defs.h ${WRKSRC}/vsftpd.conf ${REINPLACE_CMD} -e "s|/etc/v|${PREFIX}/etc/v|" \ ${WRKSRC}/vsftpd.8 ${WRKSRC}/vsftpd.conf.5 ${WRKSRC}/tunables.c - ${REINPLACE_CMD} \ + ${REINPLACE_CMD} ${VSFTPD_NO_OPTIMIZED} \ -e "s|^CC = gcc|CC = ${CC}|" \ -e "s|^CFLAGS =|CFLAGS = ${CFLAGS}|" \ - -e "s|^INSTALL =|INSTALL = ${INSTALL_PROGRAM}|" \ - -e "s| -Wl,-s| -Wl,-s ${LDFLAGS:S/-rpath=/-Wl,-rpath,/g}|" \ + -e "s|$$(INSTALL) -m 755=|$${INSTALL_PROGRAM}|" \ + -e "s| -Wl,-s| -Wl ${LDFLAGS:S/-rpath=/-Wl,-rpath,/g}|" \ ${WRKSRC}/Makefile ${REINPLACE_CMD} -e '/-lutil/d' ${WRKSRC}/vsf_findlibs.sh @${ECHO_CMD} "secure_chroot_dir=${PREFIX}/share/vsftpd/empty" >> \ _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
State Changed From-To: analyzed->closed all issues solved.