Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2018 18:46:08 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r472625 - head/misc/mbuffer/files
Message-ID:  <201806171846.w5HIk8bV064962@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Sun Jun 17 18:46:08 2018
New Revision: 472625
URL: https://svnweb.freebsd.org/changeset/ports/472625

Log:
  Unbreak misc/mbuffer when objdump is missing (for example on aarch64)
  
  The configure script uses objdump to check for libc symbol names
  for open/read/write/fstat.  We could switch it to nm or readelf but
  as the names are unlikely to ever going to differ from their visible
  names on FreeBSD hardcode them instead and skip the check.

Added:
  head/misc/mbuffer/files/
  head/misc/mbuffer/files/patch-configure   (contents, props changed)

Added: head/misc/mbuffer/files/patch-configure
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/misc/mbuffer/files/patch-configure	Sun Jun 17 18:46:08 2018	(r472625)
@@ -0,0 +1,169 @@
+Remove objdump and open/read/write/fstat symbol names check.  objdump
+is not available on all architectures and the symbol names are
+unlikely to ever change from their visible names on FreeBSD.
+
+--- configure.orig	2018-05-05 15:01:58 UTC
++++ configure
+@@ -628,7 +628,6 @@ ALLOCA
+ EGREP
+ GREP
+ CPP
+-OBJDUMP
+ AWK
+ TAR
+ MT
+@@ -4242,51 +4241,7 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
+-for ac_prog in objdump gobjdump
+-do
+-  # Extract the first word of "$ac_prog", so it can be a program name with args.
+-set dummy $ac_prog; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_path_OBJDUMP+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  case $OBJDUMP in
+-  [\\/]* | ?:[\\/]*)
+-  ac_cv_path_OBJDUMP="$OBJDUMP" # Let the user override the test with a path.
+-  ;;
+-  *)
+-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    ac_cv_path_OBJDUMP="$as_dir/$ac_word$ac_exec_ext"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+ 
+-  ;;
+-esac
+-fi
+-OBJDUMP=$ac_cv_path_OBJDUMP
+-if test -n "$OBJDUMP"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+-$as_echo "$OBJDUMP" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-  test -n "$OBJDUMP" && break
+-done
+-
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+ $as_echo_n "checking return type of signal handlers... " >&6; }
+ if ${ac_cv_type_signal+:} false; then :
+@@ -4931,11 +4886,7 @@ fi
+ 
+ 
+ 
+-if test -z "$OBJDUMP"; then
+-	as_fn_error $? "unable to find objdump" "$LINENO" 5
+-fi
+ 
+-
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5
+ $as_echo_n "checking whether to enable assertions... " >&6; }
+   # Check whether --enable-assert was given.
+@@ -6129,86 +6080,12 @@ fi
+ fi
+ 
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linking open() and write() to detect libc names" >&5
+-$as_echo_n "checking linking open() and write() to detect libc names... " >&6; }
+-ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+-
+-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-
+-		#define _LARGEFILE64_SOURCE
+-		#include <unistd.h>
+-		#include <fcntl.h>
+-		#include <sys/stat.h>
+-		int main(int argc, char **argv) {
+-			unsigned x;
+-			struct stat st;
+-			open(*argv,O_RDONLY);
+-			fstat(0,&st);
+-			read(0,&x,sizeof(x));
+-			write(1,"null",4);
+-		}
+-
+-_ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
+-
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
+-$as_echo "OK" >&6; }
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking name of open() in C library" >&5
+-$as_echo_n "checking name of open() in C library... " >&6; }
+-	libc_open=`$OBJDUMP -T conftest | $AWK '/\*UND\*/ && $NF ~ /^open/ { print $NF }'`
+-
+ cat >>confdefs.h <<_ACEOF
+-#define LIBC_OPEN $libc_open
++#define LIBC_OPEN open
++#define LIBC_READ read
++#define LIBC_WRITE write
++#define LIBC_FSTAT fstat
+ _ACEOF
+-
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_open" >&5
+-$as_echo "$libc_open" >&6; }
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking name of read() in C library" >&5
+-$as_echo_n "checking name of read() in C library... " >&6; }
+-	libc_read=`$OBJDUMP -T conftest | $AWK '/\*UND\*/ && $NF ~ /^read/ { print $NF }'`
+-
+-cat >>confdefs.h <<_ACEOF
+-#define LIBC_READ $libc_read
+-_ACEOF
+-
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_read" >&5
+-$as_echo "$libc_read" >&6; }
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking name of write() in C library" >&5
+-$as_echo_n "checking name of write() in C library... " >&6; }
+-	libc_write=`$OBJDUMP -T conftest | $AWK '/\*UND\*/ && $NF ~ /^write/ { print $NF }'`
+-
+-cat >>confdefs.h <<_ACEOF
+-#define LIBC_WRITE $libc_write
+-_ACEOF
+-
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_write" >&5
+-$as_echo "$libc_write" >&6; }
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking name of fstat() in C library" >&5
+-$as_echo_n "checking name of fstat() in C library... " >&6; }
+-	libc_fstat=`$OBJDUMP -T conftest | $AWK '/\*UND\*/ && $NF ~ /^fstat/ { print $NF }'`
+-
+-cat >>confdefs.h <<_ACEOF
+-#define LIBC_FSTAT $libc_fstat
+-_ACEOF
+-
+-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_fstat" >&5
+-$as_echo "$libc_fstat" >&6; }
+-
+-else
+-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "failed to link open/write test
+-See \`config.log' for more details" "$LINENO" 5; }
+-
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+-    conftest$ac_exeext conftest.$ac_ext
+ 
+ 
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806171846.w5HIk8bV064962>