luke-jr / bfgminer

Modular ASIC/FPGA miner written in C, featuring overclocking, monitoring, fan speed control and remote interface capabilities.
http://luke.dashjr.org/programs/bitcoin/files/bfgminer/
Other
1.83k stars 811 forks source link

3.1.3 Release - Unable to build with only cpu mining enabled #255

Closed brandondahler closed 11 years ago

brandondahler commented 11 years ago

I receive the following error when building after building with the following (abridged) configure options: "--disable-adl --disable-avalon --disable-bitforce --enable-cpumining --disable-icarus --disable-modminer --with-curses --disable-opencl --disable-scrypt --with-libudev --without-sensors --disable-x6500 --disable-ztex". Full information/commands below.

Pertinent error is:

bfgminer-deviceapi.o: In function `add_cgpu':
deviceapi.c:(.text+0x2aba): undefined reference to `detectone_meta_info'
deviceapi.c:(.text+0x2ad4): undefined reference to `detectone_meta_info'
deviceapi.c:(.text+0x2aee): undefined reference to `detectone_meta_info'
bfgminer-driver-cpu.o: In function `cpu_detect':
driver-cpu.c:(.text+0x16bd): undefined reference to `_serial_detect'
driver-cpu.c:(.text+0x16d8): undefined reference to `_serial_detect'
collect2: ld returned 1 exit status
make[2]: *** [bfgminer] Error 1

Originally found when using Gentoo's emerge with the following USE flags: cpumining hardened ncurses udev

Environment

uname -a

 Linux ********** 3.9.5-hardened #1 SMP Tue Jun 25 04:08:20 UTC 2013 x86_64 AMD Opteron(tm) Processor 4170 HE AuthenticAMD GNU/Linux

export contains no CFLAGS, CXXFLAGS, LDFLAGS, etc.

gcc -v

Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-cloog --without-ppl --disable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-esp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/python --enable-checking=release --disable-libgcj --enable-libstdcxx-time --disable-libquadmath --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 4.6.3 p1.13, pie-0.5.2'
Thread model: posix
gcc version 4.6.3 (Gentoo Hardened 4.6.3 p1.13, pie-0.5.2)

ld -v

GNU ld (GNU Binutils) 2.23.1

Building

tar -xvjf bfgminer-3.1.3.tbz2

CFLAGS="-nopie" ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-dependency-tracking --docdir=/usr/share/doc/bfgminer-3.1.3 --disable-adl --disable-avalon --disable-bitforce --enable-cpumining --disable-icarus --disable-modminer --with-curses --disable-opencl --disable-scrypt --with-system-libblkmaker --with-libudev --without-sensors --disable-x6500 --disable-ztex 2>&1 | tee ~/configure.txt

    checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89... none needed
checking dependency style of x86_64-pc-linux-gnu-gcc... none
checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C99... -std=gnu99
checking for x86_64-pc-linux-gnu-ranlib... x86_64-pc-linux-gnu-ranlib
checking whether x86_64-pc-linux-gnu-gcc -std=gnu99 needs -traditional... no
checking whether x86_64-pc-linux-gnu-gcc -std=gnu99 and cc understand -c and -o together... yes
checking for x86_64-pc-linux-gnu-ranlib... (cached) x86_64-pc-linux-gnu-ranlib
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for mprotect... yes
checking for sigaction... yes
checking for sigaltstack... yes
checking for siginterrupt... yes
checking for mmap... yes
checking for MAP_ANONYMOUS... yes
checking whether memchr works... yes
checking whether memmem is declared... yes
checking for memmem... yes
checking whether memmem works... yes
checking for C/C++ restrict keyword... __restrict
checking for uid_t in sys/types.h... yes
checking for inline... inline
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking for wchar_t... yes
checking for unsigned long long int... yes
checking for long long int... yes
checking whether stdint.h conforms to C99... yes
checking whether memmem is declared without a macro... yes
checking whether mempcpy is declared without a macro... yes
checking whether memrchr is declared without a macro... yes
checking whether rawmemchr is declared without a macro... yes
checking whether stpcpy is declared without a macro... yes
checking whether stpncpy is declared without a macro... yes
checking whether strchrnul is declared without a macro... yes
checking whether strdup is declared without a macro... yes
checking whether strncat is declared without a macro... yes
checking whether strndup is declared without a macro... yes
checking whether strnlen is declared without a macro... yes
checking whether strpbrk is declared without a macro... yes
checking whether strsep is declared without a macro... yes
checking whether strcasestr is declared without a macro... yes
checking whether strtok_r is declared without a macro... yes
checking whether strerror_r is declared without a macro... yes
checking whether strsignal is declared without a macro... yes
checking whether strverscmp is declared without a macro... yes
checking whether strtok_r is declared... (cached) yes
checking whether memmem works in linear time... yes
checking for memmem... (cached) yes
checking whether memmem works... (cached) yes
checking for struct sigaction.sa_sigaction... yes
checking for volatile sig_atomic_t... yes
checking for sighandler_t... yes
checking whether sigaction is declared without a macro... yes
checking whether sigaddset is declared without a macro... yes
checking whether sigdelset is declared without a macro... yes
checking whether sigemptyset is declared without a macro... yes
checking whether sigfillset is declared without a macro... yes
checking whether sigismember is declared without a macro... yes
checking whether sigpending is declared without a macro... yes
checking whether sigprocmask is declared without a macro... yes
checking for sigprocmask... yes
checking whether NULL can be used in arbitrary expressions... yes
checking for strtok_r... yes
checking whether strtok_r works... yes
checking for ANSI C header files... (cached) yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking sys/epoll.h usability... yes
checking sys/epoll.h presence... yes
checking for sys/epoll.h... yes
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking whether HASH_ITER is declared... yes
checking whether DL_FOREACH_SAFE is declared... yes
checking for pthread_cancel... with -pthread -lpthread
checking for nanosleep... yes
checking for x86_64-pc-linux-gnu-pkg-config... /usr/bin/x86_64-pc-linux-gnu-pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for JANSSON... yes
checking for x86_64-pc-linux-gnu-pkg-config... (cached) /usr/bin/x86_64-pc-linux-gnu-pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBUSB... no
checking for libusb_init in -lusb-1.0... no
checking for libusb_init in -lusb... no
checking for best native curses library... ncursesw5
checking for libblkmaker... yes
checking for yasm... /usr/bin/yasm
checking if yasm version is greater than 1.0.1... yes
checking for LIBCURL... yes
checking for setrlimit... yes
checking for roundl function... yes
checking for bswap_* functions... found in byteswap.h
checking if bswap_16 is already a macro... yes
checking for platform endian... little endian (endian.h)
checking if GNU format attribute compiles... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating x86_64/Makefile
config.status: creating x86_32/Makefile
config.status: creating ccan/Makefile
config.status: creating lib/Makefile
config.status: creating config.h
config.status: executing depfiles commands

------------------------------------------------------------------------
bfgminer 3.1.3
------------------------------------------------------------------------

Configuration Options Summary:

  curses.TUI...........: FOUND: ncursesw5
  scrypt...............: Disabled

  OpenCL...............: Disabled
    sensors.monitoring.: n/a
    ADL.monitoring.....: n/a
  Avalon.ASICs.........: Disabled
  BitForce.devices.....: Disabled
  Icarus.FPGAs.........: Disabled
  ModMiner.FPGAs.......: Disabled
  X6500.FPGAs..........: Disabled
  ZTEX.FPGAs...........: Disabled

  CPU Mining...........: Enabled
  ASM.(for CPU mining).: true

Compilation............: make (or gmake)
  CPPFLAGS.............: -I/usr/include/ncursesw -pthread
  CFLAGS...............: -nopie -pthread
  LDFLAGS..............: -pthread -lpthread
  LDADD................: -lcurl -ljansson -L/usr/lib64 -lncursesw -lm

Installation...........: make install (as root if needed, with 'su' or 'sudo')
  prefix...............: /usr

make 2>&1 | tee ~/make.txt

   make  all-recursive
make[1]: Entering directory `/home/brandon/bfgminer'
Making all in lib
make[2]: Entering directory `/home/brandon/bfgminer/lib'
  GEN      arg-nonnull.h
  GEN      c++defs.h
  GEN      warn-on-use.h
  GEN      signal.h
  GEN      string.h
make  all-recursive
make[3]: Entering directory `/home/brandon/bfgminer/lib'
make[4]: Entering directory `/home/brandon/bfgminer/lib'
  CC       dummy.o
  AR       libgnu.a
make[4]: Leaving directory `/home/brandon/bfgminer/lib'
make[3]: Leaving directory `/home/brandon/bfgminer/lib'
make[2]: Leaving directory `/home/brandon/bfgminer/lib'
Making all in ccan
make[2]: Entering directory `/home/brandon/bfgminer/ccan'
  CC       libccan_a-helpers.o
  CC       libccan_a-opt.o
  CC       libccan_a-parse.o
  CC       libccan_a-usage.o
  AR       libccan.a
make[2]: Leaving directory `/home/brandon/bfgminer/ccan'
Making all in x86_64
make[2]: Entering directory `/home/brandon/bfgminer/x86_64'
/usr/bin/yasm -f elf64 -o sha256_xmm_amd64.o sha256_xmm_amd64.asm
/usr/bin/yasm -f elf64 -o sha256_sse4_amd64.o sha256_sse4_amd64.asm
  AR       libx8664.a
make[2]: Leaving directory `/home/brandon/bfgminer/x86_64'
make[2]: Entering directory `/home/brandon/bfgminer'
  CC       bfgminer-miner.o
  CC       bfgminer-deviceapi.o
  CC       bfgminer-util.o
  CC       bfgminer-sha2.o
  CC       bfgminer-api.o
  CC       bfgminer-logging.o
  CC       bfgminer-driver-opencl.o
  CC       bfgminer-sha256_generic.o
  CC       bfgminer-sha256_via.o
  CC       bfgminer-sha256_cryptopp.o
  CC       bfgminer-sha256_sse2_amd64.o
  CC       bfgminer-sha256_sse4_amd64.o
  CC       bfgminer-sha256_altivec_4way.o
  CC       bfgminer-driver-cpu.o
  CC       bfgminer-dynclock.o
make -C lib
make[3]: Entering directory `/home/brandon/bfgminer/lib'
make  all-recursive
make[4]: Entering directory `/home/brandon/bfgminer/lib'
make[5]: Entering directory `/home/brandon/bfgminer/lib'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/home/brandon/bfgminer/lib'
make[4]: Leaving directory `/home/brandon/bfgminer/lib'
make[3]: Leaving directory `/home/brandon/bfgminer/lib'
  CCLD     bfgminer
bfgminer-deviceapi.o: In function `add_cgpu':
deviceapi.c:(.text+0x2aba): undefined reference to `detectone_meta_info'
deviceapi.c:(.text+0x2ad4): undefined reference to `detectone_meta_info'
deviceapi.c:(.text+0x2aee): undefined reference to `detectone_meta_info'
bfgminer-driver-cpu.o: In function `cpu_detect':
driver-cpu.c:(.text+0x16bd): undefined reference to `_serial_detect'
driver-cpu.c:(.text+0x16d8): undefined reference to `_serial_detect'
collect2: ld returned 1 exit status
make[2]: *** [bfgminer] Error 1
make[2]: Leaving directory `/home/brandon/bfgminer'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/brandon/bfgminer'
make: *** [all] Error 2
luke-jr commented 11 years ago

Fixed by 37201d7