Bug 188055 - devel/xc3sprog fails to compile
Summary: devel/xc3sprog fails to compile
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dave
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-29 18:10 UTC by Dave
Modified: 2014-09-11 15:51 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (721 bytes, patch)
2014-03-29 18:10 UTC, Dave
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave 2014-03-29 18:10:00 UTC
devel/xc3sprog fails to compile

# make
===>   xc3sprog-r449_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by xc3sprog-r449_1 for building
===>  Extracting for xc3sprog-r449_1
=> SHA256 Checksum OK for xc3sprog-r449.tar.gz.
===>  Patching for xc3sprog-r449_1
===>   xc3sprog-r449_1 depends on file: /usr/local/bin/cmake - found
===>   xc3sprog-r449_1 depends on shared library: ftdi - found
===>  Configuring for xc3sprog-r449_1
===>  Performing in-source build
/bin/mkdir -p /usr/ports/devel/xc3sprog/work/xc3sprog-r449
-- The C compiler identification is Clang 3.3.0
-- The CXX compiler identification is Clang 3.3.0
-- Check for working C compiler: /usr/local/libexec/ccache/world/cc
-- Check for working C compiler: /usr/local/libexec/ccache/world/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.28") 
-- checking for module 'libftdi'
--   found libftdi, version 0.20
-- Found LIBFTDI: /usr/local/lib/libftdi.so  
-- Could NOT find Subversion (missing:  Subversion_SVN_EXECUTABLE) 
-- checking for module 'libusb'
--   package 'libusb' not found
-- Found LIBUSB: /usr/lib/libusb.so  
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_FLAGS_DEBUG
    CMAKE_C_FLAGS_DEBUG
    CMAKE_C_FLAGS_RELEASE
    CMAKE_MODULE_LINKER_FLAGS
    CMAKE_SHARED_LINKER_FLAGS
    THREADS_HAVE_PTHREAD_ARG


-- Build files have been written to: /usr/ports/devel/xc3sprog/work/xc3sprog-r449
===>  Building for xc3sprog-r449_1
[  4%] Generating config.h
Scanning dependencies of target xc3sproglib
[ 26%] Building CXX object CMakeFiles/xc3sproglib.dir/jedecfile.cpp.o
[ 17%] Building CXX object CMakeFiles/xc3sproglib.dir/ioftdi.cpp.o
[ 34%] Building CXX object CMakeFiles/xc3sproglib.dir/iobase.cpp.o
[ 13%] Building CXX object CMakeFiles/xc3sproglib.dir/jtag.cpp.o
[ 26%] Building CXX object CMakeFiles/xc3sproglib.dir/ioparport.cpp.o
[ 39%] Building CXX object CMakeFiles/xc3sproglib.dir/progalgxc95x.cpp.o
[ 34%] Building CXX object CMakeFiles/xc3sproglib.dir/bitfile.cpp.o
[ 13%] Building CXX object CMakeFiles/xc3sproglib.dir/iofx2.cpp.o
/usr/ports/devel/xc3sprog/work/xc3sprog-r449/iobase.cpp:36:17: warning: using directive refers to implicitly-defined namespace 'std'
using namespace std;
                ^
1 warning generated.
[ 43%] Building CXX object CMakeFiles/xc3sproglib.dir/utilities.cpp.o
/usr/ports/devel/xc3sprog/work/xc3sprog-r449/jedecfile.cpp:437:7: error: unknown type name 'time_t'
      time_t t;
      ^
/usr/ports/devel/xc3sprog/work/xc3sprog-r449/jedecfile.cpp:440:11: error: use of undeclared identifier 'time'
      t = time(NULL);
          ^
/usr/ports/devel/xc3sprog/work/xc3sprog-r449/jedecfile.cpp:444:8: error: use of undeclared identifier 'strftime'
          if (strftime(outstr, sizeof(outstr), "%a %b %d %T %Y", tmp))
              ^
In file included from /usr/ports/devel/xc3sprog/work/xc3sprog-r449/jedecfile.cpp:29:
/usr/ports/devel/xc3sprog/work/xc3sprog-r449/jedecfile.h:56:8: warning: private field 'Error' is not used [-Wunused-private-field]
  bool Error;
       ^
/usr/ports/devel/xc3sprog/work/xc3sprog-r449/jedecfile.h:58:9: warning: private field 'logfile' is not used [-Wunused-private-field]
  FILE *logfile;
        ^
2 warnings and 3 errors generated.
--- CMakeFiles/xc3sproglib.dir/jedecfile.cpp.o ---
*** [CMakeFiles/xc3sproglib.dir/jedecfile.cpp.o] Error code 1

make[4]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
/usr/ports/devel/xc3sprog/work/xc3sprog-r449/ioftdi.cpp:41:17: error: use of undeclared identifier 'getenv'
  char *fname = getenv("FTDI_DEBUG");
                ^
1 error generated.
--- CMakeFiles/xc3sproglib.dir/ioftdi.cpp.o ---

*** [CMakeFiles/xc3sproglib.dir/ioftdi.cpp.o] Error code 1

make[4]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
2 errors

make[4]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
--- CMakeFiles/xc3sproglib.dir/all ---
*** [CMakeFiles/xc3sproglib.dir/all] Error code 2

make[3]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
1 error

make[3]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
--- CMakeFiles/xc3sprog.dir/rule ---
*** [CMakeFiles/xc3sprog.dir/rule] Error code 2

make[2]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
1 error

make[2]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
--- xc3sprog ---
*** [xc3sprog] Error code 2

make[1]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
1 error

make[1]: stopped in /usr/ports/devel/xc3sprog/work/xc3sprog-r449
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/xc3sprog

Fix: edit ioftdi.cpp and jedecfile.cpp as shown below:


 # diff -ur xc3sprog-r449.old/ xc3sprog-r449/
diff -ur xc3sprog-r449.old/ioftdi.cpp xc3sprog-r449/ioftdi.cpp
--- xc3sprog-r449.old/ioftdi.cpp        2014-03-29 18:50:39.000000000 +0100
+++ xc3sprog-r449/ioftdi.cpp    2014-03-29 18:52:32.000000000 +0100
@@ -23,6 +23,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
+#include <stdlib.h>
 
 #include "ioftdi.h"
 #include "io_exception.h"
diff -ur xc3sprog-r449.old/jedecfile.cpp xc3sprog-r449/jedecfile.cpp
--- xc3sprog-r449.old/jedecfile.cpp     2014-03-29 18:50:39.000000000 +0100
+++ xc3sprog-r449/jedecfile.cpp 2014-03-29 18:51:59.000000000 +0100
@@ -25,6 +25,7 @@
 #include <strings.h>
 #include <errno.h>
 #include <cstdio>
+#include <time.h>
 
 #include "jedecfile.h"
 #include "io_exception.h"


I thank the maintainer for the help! 

Patch attached with submission follows:
How-To-Repeat: cd /usr/ports/devel/xc3sprog && make
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-29 18:10:04 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wkoszek

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-08-03 11:26:52 UTC
A commit references this bug:

Author: pi
Date: Sun Aug  3 11:25:55 UTC 2014
New revision: 363876
URL: http://svnweb.freebsd.org/changeset/ports/363876

Log:
  devel/xc3sprog: r449 -> r769, new distsite, stagify

  PR:		188055
  Submitted by:	pi
  Approved by:	wkoszek@FreeBSD.org (maintainer timeout)

Changes:
  head/devel/xc3sprog/Makefile
  head/devel/xc3sprog/distinfo
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2014-08-03 11:27:58 UTC
I committed an update to a more recent version. Can you check/test,
whether it does fix your problem ? Thanks in advance!
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-08-03 19:37:34 UTC
A commit references this bug:

Author: pi
Date: Sun Aug  3 19:37:22 UTC 2014
New revision: 363933
URL: http://svnweb.freebsd.org/changeset/ports/363933

Log:
  devel/xc3sprog: change to USES=cmake

  PR:		188055
  Submitted by:	makc, bapt

Changes:
  head/devel/xc3sprog/Makefile
  head/devel/xc3sprog/distinfo
  head/devel/xc3sprog/files/
  head/devel/xc3sprog/files/patch-CMakeLists.txt
  head/devel/xc3sprog/files/patch-utilities.cpp
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2014-08-03 19:42:47 UTC
If I used USES=cmake, the call to cmake according to make -d all was:

http://people.freebsd.org/~pi/misc/mycmake-call.txt

and the cmake call died with SIGSEGV.

If I removed

-DCMAKE_C_COMPILER:STRING="cc"
-DCMAKE_CXX_COMPILER:STRING="c++"

from the call, it worked. Well, gdb (fresh from PR 192323) to the rescue.

Apparently, if the .txz file has some WRKSRC/CMakeFiles/
and WRKSRC/CMakeCache.txt leftovers, cmake is not very
error tolerant: It dies in:
 
#2  0x0000000000488562 in cmake::HandleDeleteCacheVariables(char const*) ()
 
So, I found out that the xc3sprog r769 .txz that I generated had
some leftovers from my tests with cmake in it. They killed cmake
when it was called from the build process.

I cleaned up the distfile, and cmake was happy.
Comment 6 Tilman Keskinoz freebsd_committer freebsd_triage 2014-09-11 15:42:58 UTC
Can this PR be closed or are there still unresolved issues? Kurt?
Comment 7 Kurt Jaeger freebsd_committer freebsd_triage 2014-09-11 15:51:02 UTC
Still waiting for feedback from bug submitter. Let's close it, if there still is
an open issue, a new PR can be opened.