Typical pkgsrc error messages
From NetBSD Wiki
Compiling C files
CURLOPT_MUTE undeclared
Since libcurl version 7.16.0, this option has been removed. Since there are no documented guidelines telling what to do with applications that still use this option, I have decided to simply remove it from the code. An example can be seen here:
__PRETTY_FUNCTION__ is not defined
- Problem: The identifier (not a macro) __PRETTY_FUNCTION__ is specific to the GNU compilers.
- Solution: Add -D__PRETTY_FUNCTION__=__func__ to the CPPFLAGS.
__func__ is not defined
- Problem: In C programs, __func__ is an identifier containing the name of the current function. In standard C++, there is no such identifier, but the GNU C++ compiler supports it.
- Solution 1 (hack): Add -D__func__=__FILE__ to the CXXFLAGS.
- Solution 2: For the sunpro compiler, you can also add -features=extensions to the CXXFLAGS.
Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications
This problem happens on Solaris.
- Compiler: SunPro.
- Problem: The option -xc99 is given to the SunPro compiler, but there is some conflicting setting of one of the _XOPEN_SOURCE or _POSIX_C_SOURCE macros.
- Solution: Add -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ to the CPPFLAGS.
- Compiler: GCC.
- Problem: package Makefile contains a line similar to the following USE_LANGUAGES=c99, this causes -std=gnu99 option to be passed to gcc which in turn causes the error.
- Solution: try to change c99 to c or remove it altogether; package may fail to compile if it really and truly depends on -std=gnu99 option.
This will probably be handled globally in the pkgsrc compiler wrappers.
See also:
reference to static identifier "audio_fd" in extern inline function
- Compiler: sunpro 5.8
- Problem: There is an inline function in the code that is not marked as static.
- Solution: Add the static storage class to the function definition, just before the inline keyword.
- If you get undefined references later in the link phase, you may need to remove both, the static and the inline.
This header file is to be used only for c99 mode compilations
cc-1035 CC: WARNING File = /usr/include/stdint.h, Line = 5
#error directive: This header file is to be used only for c99 mode
compilations
This error message is printed by MIPSpro when you try to use the <stdint.h> from a C program without having the -c99 option. The solution is easy: Add -c99 to the compiler flags.
The same message is also printed when using the header from a C++ program, whether the -c99 option is given or not. I have no idea how to fix that.
Compiling C++ files
Could not find a match for std::multimap<...>::insert(std::pair<...,...>)
- Compiler: Sun C++ 5.9
- Cause: the multimap classes don't have a method insert(pair<First, Second>), only insert(pair<const First, Second>).
- Solution: Instead of insert(make_pair(first, second)), use insert(mm::value_type(first, second)).
Linking
On Solaris, when using the SunPro C++ compiler, there are sometimes duplicate definitions for variables. This may be due to Template Definition Searching (Section 7.5).
Undefined reference to ...
- gettext: Add -lintl to LIBS.
- libintl_gettext: Add LIBS+=${BUILDLINK_LDADD.gettext} to the package Makefile, then clean up and retry.
- libintl_textdomain: See libintl_gettext.
- libintl_bindtextdomain: See libintl_gettext.
Undefined reference to fd_log
- Problem: A package needs fdlibm, but the latter is not in pkgsrc.
- Solution (hack): Remove the need for the library by using the standard functions from the system-provided libm instead.
R_SPARC_H44, ABS44
- Platform: SunOS-5.10-sparc
- Compiler: sunpro
- Package path: www/py-clearsilver
- Package name: py24-clearsilver-0.10.1nb1
- Exact error message:
ld: fatal: relocation error: R_SPARC_H44: file ../libs//libneo_cgi.a(cgiwrap.o): symbol $XAFlAZGPIZpFGuH.GlobalWrapper: relocations based on the ABS44 coding model can not be used in building a shared object
- Problem: A file is compiled without the PIC compiler flag and later linked to a shared library.
- Solution: Template:FIXME
How I found the real problem
- I first looked at the .work.log file to see how the compiler for the file cgiwrap.o had been invoked. It was without any PIC flag, but with the 64-bit ABI flags.
- Then, I noticed some files that had been compiled with the -Kpic -xcode=pic32 flags. At the first sight it looks weird to have 64-bit flags combined with 32-bit flags, but according to the cc manual page, this is correct.
- Template:FIXME
ld: fatal: library -lstdc++: not found
- Problem: You are building a package that assumes the compiler is GCC, but you are using a different compiler.
- Solution: Add BUILDLINK_TRANSFORM+= rm:-lstdc++ to the package Makefile.
If the program used for linking is the C compiler (which should never be the case, but some people don't know better), you need to add MAKE_FLAGS+= CCLD=${CXX:Q} to the package Makefile.
ld: fatal: file not found: lX11
- Problem: If you are on Solaris, using PKGSRC_COMPILER=sunpro and have sunpro in a non-default directory and building emacs-22, you got bitten by incompetent use of the C preprocessor for processing command lines.
- Explanation: The C preprocessor may transform the expression -lX11 (which is a unary negation) into two words, that is, - lX11. When the compiler gets these arguments on the command line, it discards the first and treats the second as file.
- Solution: Add CPP=/usr/lib/cpp to the CONFIGURE_ENV variable in emacs' package Makefile.
Installing
/bin/sh: 5: not found
- Problem:
=> Lock acquire-install-localbase-lock is held by pid 75668245 /bin/sh: 5: not found
- Cause: You have changed some locking type (PKGSRC_LOCKTYPE, LOCALBASE_LOCKTYPE or WRKDIR_LOCKTYPE) from "once" to "sleep" after a package has been built, but before it has been installed. The "sleep" tool is now required, but the tools phase is not re-done, leaving the SLEEP variable empty.
- Solution: Either "make install SLEEP=sleep" or "make clean" and try again.
chmod: Operation not permitted
When building audio/rio as an unprivileged user on NetBSD, the following occured to me:
$ chmod +s rio chmod: rio: Operation not permitted
The reason for this was that the command tried to set the setuid and setgid bits of a file, but the file's group wasn't in the list of groups:
$ ls -l rio -rwxr-xr-x 1 bulk wheel 119685 Jan 9 04:45 rio $ id uid=1012(bulk) gid=100(users) groups=100(users)
So how can this user have created this file? See the manual page for open(2), which states:
- When a new file is created it is given the group of the directory which contains it.
This is even true when the directory's group is completely unrelated to the current user.
Miscellaneous
execvp: libtool: Arg list too long
- Problem: You are probably on IRIX and are trying to build one of the bigger packages like x11/qt3-libs, which have libraries consisting of many files.
- Solution: If you are root, you can run "systune ncargs 128000" or some other value higher than 20k.
- Problem: I'm not root. :(
