View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011110CMakeCMakepublic2010-08-11 10:122015-07-08 08:57
ReporterMihai 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0011110: CMake cannot be compiled on OpenBSD 3.9
DescriptionIt seems, that the missing function,getpwuid_r, which causes the compilation of CMake on
OpenBSD to fail, is not available on OpenBSD 3.9.
According to the OpenBSD Manual pages, getpwuid_r was added in OpenBSD 4.4.
Additional Informationmake fails:

# LDLAGS="${LDFLAGS} -lpthread" CC=gcc-42 CXX="g++-42" ./configure --no-qt-gui
\
      --prefix=/opt/cmake-2.8.2
# make
[...]
/opt/gcc-4.2.4/lib/gcc/i386-unknown-openbsd3.9/4.2.4/../../../libstdc++.a(locale-inst.o)(.gnu.linkonce.t._ZSt16__convert_from_vRKPiPciPKcz+0x70):
In function `std::__convert_from_v(int* const&, char*, int, char const*, ...)':
/root/gcc/build-gcc/i386-unknown-openbsd3.9/libstdc++-v3/include/bits/locale_facets.h:2992:
warning: vsprintf() is often misused, please use vsnprintf()
../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_entry.c.o)(.text+0xe9):
In function `aes_copy':
: warning: wcscpy() is almost always misused, please use wcslcpy()
CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.o(.text+0x825): In
function `cmCursesLongMessageForm::UpdateStatusBar()':
: warning: strcpy() is almost always misused, please use strlcpy()
CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.o(.text+0x29c): In
function `cmCursesLongMessageForm::HandleInput()':
: warning: sprintf() is often misused, please use snprintf()
libCMakeLib.a(cmCommandArgumentParserHelper.o)(.text+0xf60): In function
`cmCommandArgumentParserHelper::CombineUnions(char*, char*)':
: warning: strcat() is almost always misused, please use strlcat()
../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_read_disk_set_standard_lookup.c.o)(.text+0x343):
In function `lookup_uname_helper':
: undefined reference to `getpwuid_r'
collect2: ld returned 1 exit status
make[2]: *** [bin/ccmake] Error 1
make[1]: *** [Source/CMakeFiles/ccmake.dir/all] Error 2
make: *** [all] Error 2
#

using gcc-3.3.5 by configuring with
# ./configure --no-qt-gui --prefix=/opt/cmake-2.8.2
produces the same error
TagsNo tags attached.
Attached Filespatch file icon cmlibarchive_without_getNNN_r.patch [^] (4,468 bytes) 2010-09-02 09:52 [Show Content]
patch file icon cmlibarchive_without_getNNN_r-2.patch [^] (5,579 bytes) 2010-09-03 01:56 [Show Content]

 Relationships

  Notes
(0021708)
Bill Hoffman (manager)
2010-08-11 10:41

Please try git master or next of CMake. We now have a dashboard for OpenBSD, and have done the porting work. What version of CMake are you using?
(0021726)
Mihai (reporter)
2010-08-12 03:29

version of cmake that I tried to install is 2.8.2. Should I try with git master?
(0021727)
Bill Hoffman (manager)
2010-08-12 08:07

Yes, try git master or git next.
(0021740)
Matthias (reporter)
2010-08-13 07:16

Tried to compile git master of CMake on OpenBSD 3.9, but make failed with the same error. OpenBSD does not provide getpwuid_r until Version 4.4.
Is there maybe a configure switch to CMake? Version 2.6.4 compiles just fine.
(0021773)
Bill Hoffman (manager)
2010-08-16 10:23

OK, we are only nightly testing on OpenBSD 4.6 (i386)-gcc 4.2.4-gmake. If you want to provide a patch that would be good. We don't have access to a 3.9 machine.
(0021890)
Mihai (reporter)
2010-08-23 08:02

And how can I help?
(0021893)
Bill Hoffman (manager)
2010-08-23 10:46

Create a patch and run a nightly dashboard.
(0022073)
Matthias (reporter)
2010-09-02 09:52

Comparing the included Utilities/cmlibarchive/libarchive/archive_read_disk_set_standard_lookup.c (where the error seems to happen) to the same file in the standalone libarchive, I found that some preprocessor instructions and code for handling systems without getpwuid_r (and similar functions) had been removed, together with the corresponding instructions in CMakeLists.txt.

Patching the lines from the standalone libarchive into cmlibarchive seems to solve the problem. But I'm no C-programmer and so I cannot tell for what reason this code had been removed or if reinserting it will have some side effects.

I attached a patch against the 2.8.2-release.
(0022074)
Bill Hoffman (manager)
2010-09-02 12:39

the new try-compile results need to be referenced in
build/cmake/config.h.in so that they are visible in the source. Can you add that part to the patch and attach a new patch?
(0022080)
Matthias (reporter)
2010-09-03 02:12

Hmm, I'm not sure, what you mean, but I took a diff between libarchive-2.8.4/build/cmake/config.h.in and cmake-2.8.2/Utilities/cmlibarchive/build/cmake/config.h.in. Then I copied the lines, which seemed relevant.

Attached new patch cmlibarchive_without_getNNN_r-2.patch

(As you can see, this is really not my area of expertise and I'm heavily relying on the Frankenstein-approach.)
(0022475)
Mihai (reporter)
2010-10-12 04:03

The patch provided by Matthias is working very well.
(0022477)
Bill Hoffman (manager)
2010-10-12 10:08

Can either of you run a nightly dashboard on this system? I would like to make sure it keeps on working.

Thanks.
(0022491)
Matthias (reporter)
2010-10-14 03:55

Ok. I'm still not sure what exactly a "nightly dashboard" is, but looking into the wiki I figured it may have to do something with the nightly and/or dashboard branches of the git-tree. So I did the following:

# # unfortunately there is no git available on the system in question:
# cvs -d :pserver:anonymous@cmake.org:/cmake.git co -d CMake nightly
# cd CMake
# patch -p1 cmlibarchive_without_getNNN_r-2.patch
# CXXFLAGS="${CXXFLAGS} -pthread" \
> CC=/opt/gcc-4.2.4/bin/gcc \
> CXX="/opt/gcc-4.2.4/bin/g++" \
> ./configure --no-qt-gui --prefix=/tmp/test/cm-n-gcc42
# make
# make install

Everything worked like intended: The patch applied without even a warning. Configure and make also completed successfully

# /tmp/test/cm-n-gcc42/bin/cmake --version
cmake version 2.8.2.20101012-cvs-nightly

For testing I built the (also patched) 2.8.2 realease of cmake

# tar xfz cmake-2.8.2.tar.gz
# cd cmake-2.8.2
# patch -p1 cmlibarchive_without_getNNN_r-2.patch
# CXXFLAGS="${CXXFLAGS} -pthread" \
> CC=/opt/gcc-4.2.4/bin/gcc \
> CXX="/opt/gcc-4.2.4/bin/g++" \
> /tmp/test/cm-n-gcc42/bin/cmake .
# make
# bin/cmake --version
cmake verison 2.8.2

So it seems to be working just fine.
I hope this is what you asked for.

Thanks.
(0022492)
Bill Hoffman (manager)
2010-10-14 09:44

by nightly dashboard, I mean a cronjob on your machine that builds CMake from git next once a day. For instructions see here:

http://www.cmake.org/cmake/resources/testing.html [^]

I want to make sure that your work is not "undone" by someone in the future.
(0031867)
Amit Kulkarni (reporter)
2012-12-11 14:48

can you close this? openbsd 3.9 was released may 1, 2006, cmake since then works on openbsd...

won't fix
(0039081)
Robert Maynard (manager)
2015-07-08 08:57

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2010-08-11 10:12 Mihai New Issue
2010-08-11 10:41 Bill Hoffman Note Added: 0021708
2010-08-11 10:41 Bill Hoffman Status new => assigned
2010-08-11 10:41 Bill Hoffman Assigned To => Bill Hoffman
2010-08-12 03:29 Mihai Note Added: 0021726
2010-08-12 08:07 Bill Hoffman Note Added: 0021727
2010-08-13 07:16 Matthias Note Added: 0021740
2010-08-16 10:23 Bill Hoffman Note Added: 0021773
2010-08-23 08:02 Mihai Note Added: 0021890
2010-08-23 10:46 Bill Hoffman Note Added: 0021893
2010-09-02 09:52 Matthias Note Added: 0022073
2010-09-02 09:52 Matthias File Added: cmlibarchive_without_getNNN_r.patch
2010-09-02 12:39 Bill Hoffman Note Added: 0022074
2010-09-03 01:56 Matthias File Added: cmlibarchive_without_getNNN_r-2.patch
2010-09-03 02:12 Matthias Note Added: 0022080
2010-10-12 04:03 Mihai Note Added: 0022475
2010-10-12 10:08 Bill Hoffman Note Added: 0022477
2010-10-14 03:55 Matthias Note Added: 0022491
2010-10-14 09:44 Bill Hoffman Note Added: 0022492
2012-12-11 14:48 Amit Kulkarni Note Added: 0031867
2015-02-26 16:23 Stephen Kelly Status assigned => resolved
2015-02-26 16:23 Stephen Kelly Resolution open => no change required
2015-07-08 08:57 Robert Maynard Note Added: 0039081
2015-07-08 08:57 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team