nss 3.35 issue with nspr 4.19 PR_GetEnvSecure function - nss

I am getting the following error while building nss 3.35 version
secoid.c:(.text.SECOID_Init+0x36): undefined reference to PR_GetEnvSecure'
secoid.c:(.text.SECOID_Init+0x55): undefined reference toPR_GetEnvSecure'
I am using nspr version 4.19 to build this.
Here is my command to build nss
make -j1 BUILD_OPT=1 NSPR_INCLUDE_DIR=nss-3.36.1/nspr/include/nspr USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz NSS_ENABLE_WERROR=0 $([ $(uname -m ) = x86_64 ] && echo USE_64=1 ) $([ -f /usr/include/sqlite3.h ] && echo NSS_USE_SYSTEM_SQLITE=1 )

This is a similar issue reported in Red Hat Bugzilla 1458841.
In that case they removed the dependency on this object.
In Red Hat 7.6 this object is defined in library "/lib64/libnspr4.so" as you can see below.
objdump -TC /lib64/libnspr4.so | grep PR_GetEnvSecure
0000000000019b60 g DF .text 0000000000000067 Base PR_GetEnvSecure
You need to build NPSR library version that defines this object, for example version 4.19

Related

Building Qt 5.15.2 with MinGW-W64 gcc 12.2.0 fails with an undefined reference linking error

I have been trying to build Qt 5.15.2 with MinGW-W64 gcc 12.2.0 with no avail. In each failure, I had to patch the file in question and restart again.
Here are the patches I did so far:
in the file:
C:\Dev\qt5\qtbase\src\corelib\io\qfilesystemengine_win.cpp
I had Fix:
#if defined(Q_CC_MINGW) && WINVER < 0x0602 // Windows 8 onwards
to
#if defined(Q_CC_MINGW) && WINVER < 0x0602 && _WIN32_WINNT < _WIN32_WINNT_WIN8 // Windows 8 onwards
in all the following files:
C:\Dev\qt5\qtbase\src\3rdparty\angle\src\libANGLE\HandleAllocator.cpp
C:\Dev\qt5\qtbase\src\corelib\text\qbytearraymatcher.h
C:\Dev\qt5\qtbase\src\corelib\global\qfloat16.h
C:\Dev\qt5\qtdeclarative\src\3rdparty\masm\yarr\Yarr.h
I had to #include <limits>
But when I came across this link error, I couldn't find the cause at all, here are the last two lines from the output:
g++ -Wl,-s -shared -Wl,-subsystem,console -Wl,--out-implib,C:\Dev\qt5\qtdeclarative\lib\libQt5QuickTest.a -o ..\..\lib\Qt5QuickTest.dll .obj/release/quicktest.o .obj/release/quicktestresult.o .obj/release/qt5quicktest_qmltyperegistrations.o .obj/release/moc_quicktest_p.o C:\Dev\qt5\qtbase\lib\libQt5Test.a C:\Dev\qt5\qtbase\lib\libQt5Widgets.a C:\Dev\qt5\qtbase\lib\libQt5Gui.a C:\Dev\qt5\qtbase\lib\libQt5Core.a .obj\release\Qt5QuickTest_resource_res.o C:\Dev\qt5\qtdeclarative\lib\libQt5Quick.a C:\Dev\qt5\qtbase\lib\libQt5Gui.a C:\Dev\qt5\qtdeclarative\lib\libQt5QmlModels.a C:\Dev\qt5\qtdeclarative\lib\libQt5Qml.a C:\Dev\qt5\qtbase\lib\libQt5Network.a C:\Dev\qt5\qtbase\lib\libQt5Core.a
C:/MinGW-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .obj/release/qt5quicktest_qmltyperegistrations.o:qt5quicktest_qmltyperegistrations.cpp:(.rdata$.refptr._ZN11QQmlPrivate12ConstructorsI15QTestRootObjectLb1EE23createSingletonInstanceE[.refptr._ZN11QQmlPrivate12ConstructorsI15QTestRootObjectLb1EE23createSingletonInstanceE]+0x0): undefined reference to `QQmlPrivate::Constructors<QTestRootObject, true>::createSingletonInstance'
and here is the configure command I used:
configure -release -opensource -confirm-license -nomake tests -strip -c++std c++11 -skip qtwebengine -prefix %CD%\gcc_dll
then
mingw32-make
Seems like the build stopped at an end before crashing this link error, because I can see a bunch of built libraries that are:
C:\Dev\qt5\qtdeclarative\lib\Qt5QuickShapes.dll
C:\Dev\qt5\qtdeclarative\lib\Qt5Quick.dll
C:\Dev\qt5\qtdeclarative\lib\Qt5QmlWorkerScript.dll
C:\Dev\qt5\qtdeclarative\lib\Qt5QmlModels.dll
C:\Dev\qt5\qtdeclarative\lib\Qt5Qml.dll
C:\Dev\qt5\qtsvg\plugins\iconengines\qsvgicon.dll
C:\Dev\qt5\qtsvg\plugins\imageformats\qsvg.dll
C:\Dev\qt5\qtsvg\lib\Qt5Svg.dll
C:\Dev\qt5\qtimageformats\plugins\imageformats\qicns.dll
C:\Dev\qt5\qtimageformats\plugins\imageformats\qwebp.dll
C:\Dev\qt5\qtimageformats\plugins\imageformats\qtiff.dll
C:\Dev\qt5\qtimageformats\plugins\imageformats\qwbmp.dll
C:\Dev\qt5\qtimageformats\plugins\imageformats\qtga.dll
C:\Dev\qt5\qtserialbus\plugins\canbus\qtvectorcanbus.dll
C:\Dev\qt5\qtserialbus\plugins\canbus\qtsysteccanbus.dll
C:\Dev\qt5\qtserialbus\plugins\canbus\qttinycanbus.dll
C:\Dev\qt5\qtserialbus\plugins\canbus\qtpeakcanbus.dll
C:\Dev\qt5\qtserialbus\plugins\canbus\qtpassthrucanbus.dll
C:\Dev\qt5\qtserialbus\plugins\canbus\qtvirtualcanbus.dll
C:\Dev\qt5\qtserialbus\lib\Qt5SerialBus.dll
C:\Dev\qt5\qtserialport\lib\Qt5SerialPort.dll
C:\Dev\qt5\qtnetworkauth\lib\Qt5NetworkAuth.dll
C:\Dev\qt5\qtbase\examples\widgets\tools\styleplugin\release\styles\simplestyleplugin.dll
C:\Dev\qt5\qtbase\examples\widgets\tools\plugandpaint\plugins\pnp_extrafilters.dll
C:\Dev\qt5\qtbase\examples\widgets\tools\echoplugin\plugins\echoplugin.dll
C:\Dev\qt5\qtbase\plugins\printsupport\windowsprintersupport.dll
C:\Dev\qt5\qtbase\plugins\styles\qwindowsvistastyle.dll
C:\Dev\qt5\qtbase\plugins\generic\qtuiotouchplugin.dll
C:\Dev\qt5\qtbase\plugins\imageformats\qgif.dll
C:\Dev\qt5\qtbase\plugins\imageformats\qjpeg.dll
C:\Dev\qt5\qtbase\plugins\imageformats\qico.dll
C:\Dev\qt5\qtbase\plugins\platformthemes\qxdgdesktopportal.dll
C:\Dev\qt5\qtbase\plugins\platforms\qdirect2d.dll
C:\Dev\qt5\qtbase\plugins\platforms\qwindows.dll
C:\Dev\qt5\qtbase\plugins\platforms\qoffscreen.dll
C:\Dev\qt5\qtbase\plugins\platforms\qminimal.dll
C:\Dev\qt5\qtbase\plugins\bearer\qgenericbearer.dll
C:\Dev\qt5\qtbase\plugins\sqldrivers\qsqlite.dll
C:\Dev\qt5\qtbase\plugins\sqldrivers\qsqlodbc.dll
C:\Dev\qt5\qtbase\lib\Qt5OpenGL.dll
C:\Dev\qt5\qtbase\lib\Qt5PrintSupport.dll
C:\Dev\qt5\qtbase\lib\Qt5Concurrent.dll
C:\Dev\qt5\qtbase\lib\Qt5DBus.dll
C:\Dev\qt5\qtbase\lib\Qt5Test.dll
C:\Dev\qt5\qtbase\lib\Qt5Widgets.dll
C:\Dev\qt5\qtbase\lib\Qt5Gui.dll
C:\Dev\qt5\qtbase\lib\libEGL.dll
C:\Dev\qt5\qtbase\lib\libGLESv2.dll
C:\Dev\qt5\qtbase\lib\Qt5Xml.dll
C:\Dev\qt5\qtbase\lib\Qt5Sql.dll
C:\Dev\qt5\qtbase\lib\Qt5Network.dll
C:\Dev\qt5\qtbase\lib\Qt5Core.dll
C:\Dev\qt5\gnuwin32\lib\regex2.dll
C:\Dev\qt5\gnuwin32\lib\libintl3.dll
C:\Dev\qt5\gnuwin32\lib\libiconv2.dll
C:\Dev\qt5\gnuwin32\lib\libcharset1.dll
C:\Dev\qt5\qtwebengine\src\3rdparty\chromium\third_party\crashpad\crashpad\handler\win\z7_test.dll
C:\Dev\qt5\qtdeclarative\lib\libQt5QuickTest.a
C:\Dev\qt5\qtdeclarative\lib\libQt5QuickShapes.a
C:\Dev\qt5\qtdeclarative\lib\libQt5Quick.a
C:\Dev\qt5\qtdeclarative\lib\libQt5QmlWorkerScript.a
C:\Dev\qt5\qtdeclarative\lib\libQt5QmlModels.a
C:\Dev\qt5\qtdeclarative\lib\libQt5Qml.a
C:\Dev\qt5\qtsvg\plugins\iconengines\libqsvgicon.a
C:\Dev\qt5\qtsvg\plugins\imageformats\libqsvg.a
C:\Dev\qt5\qtsvg\lib\libQt5Svg.a
C:\Dev\qt5\qtactiveqt\lib\libQt5AxServer.a
C:\Dev\qt5\qtactiveqt\lib\libQt5AxContainer.a
C:\Dev\qt5\qtactiveqt\lib\libQt5AxBase.a
C:\Dev\qt5\qtimageformats\plugins\imageformats\libqicns.a
C:\Dev\qt5\qtimageformats\plugins\imageformats\libqwebp.a
C:\Dev\qt5\qtimageformats\plugins\imageformats\libqtiff.a
C:\Dev\qt5\qtimageformats\plugins\imageformats\libqwbmp.a
C:\Dev\qt5\qtimageformats\plugins\imageformats\libqtga.a
C:\Dev\qt5\qtserialbus\plugins\canbus\libqtvectorcanbus.a
C:\Dev\qt5\qtserialbus\plugins\canbus\libqtsysteccanbus.a
C:\Dev\qt5\qtserialbus\plugins\canbus\libqttinycanbus.a
C:\Dev\qt5\qtserialbus\plugins\canbus\libqtpeakcanbus.a
C:\Dev\qt5\qtserialbus\plugins\canbus\libqtpassthrucanbus.a
C:\Dev\qt5\qtserialbus\plugins\canbus\libqtvirtualcanbus.a
C:\Dev\qt5\qtserialbus\lib\libQt5SerialBus.a
C:\Dev\qt5\qtserialport\lib\libQt5SerialPort.a
C:\Dev\qt5\qtnetworkauth\lib\libQt5NetworkAuth.a
C:\Dev\qt5\qtbase\examples\widgets\tools\styleplugin\release\styles\libsimplestyleplugin.a
C:\Dev\qt5\qtbase\examples\widgets\tools\plugandpaint\plugins\libpnp_extrafilters.a
C:\Dev\qt5\qtbase\examples\widgets\tools\plugandpaint\plugins\libpnp_basictools.a
C:\Dev\qt5\qtbase\examples\widgets\tools\echoplugin\plugins\libechoplugin.a
C:\Dev\qt5\qtbase\plugins\printsupport\libwindowsprintersupport.a
C:\Dev\qt5\qtbase\plugins\styles\libqwindowsvistastyle.a
C:\Dev\qt5\qtbase\plugins\generic\libqtuiotouchplugin.a
C:\Dev\qt5\qtbase\plugins\imageformats\libqgif.a
C:\Dev\qt5\qtbase\plugins\imageformats\libqjpeg.a
C:\Dev\qt5\qtbase\plugins\imageformats\libqico.a
C:\Dev\qt5\qtbase\plugins\platformthemes\libqxdgdesktopportal.a
C:\Dev\qt5\qtbase\plugins\platforms\libqdirect2d.a
C:\Dev\qt5\qtbase\plugins\platforms\libqwindows.a
C:\Dev\qt5\qtbase\plugins\platforms\libqoffscreen.a
C:\Dev\qt5\qtbase\plugins\platforms\libqminimal.a
C:\Dev\qt5\qtbase\plugins\bearer\libqgenericbearer.a
C:\Dev\qt5\qtbase\plugins\sqldrivers\libqsqlite.a
C:\Dev\qt5\qtbase\plugins\sqldrivers\libqsqlodbc.a
C:\Dev\qt5\qtbase\lib\libQt5OpenGL.a
C:\Dev\qt5\qtbase\lib\libQt5PrintSupport.a
C:\Dev\qt5\qtbase\lib\libQt5OpenGLExtensions.a
C:\Dev\qt5\qtbase\lib\libQt5WindowsUIAutomationSupport.a
C:\Dev\qt5\qtbase\lib\libQt5AccessibilitySupport.a
C:\Dev\qt5\qtbase\lib\libQt5EglSupport.a
C:\Dev\qt5\qtbase\lib\libQt5PlatformCompositorSupport.a
C:\Dev\qt5\qtbase\lib\libQt5FontDatabaseSupport.a
C:\Dev\qt5\qtbase\lib\libQt5ThemeSupport.a
C:\Dev\qt5\qtbase\lib\libQt5FbSupport.a
C:\Dev\qt5\qtbase\lib\libQt5DeviceDiscoverySupport.a
C:\Dev\qt5\qtbase\lib\libQt5EventDispatcherSupport.a
C:\Dev\qt5\qtbase\lib\libQt5EdidSupport.a
C:\Dev\qt5\qtbase\lib\libqtfreetype.a
C:\Dev\qt5\qtbase\lib\libQt5Concurrent.a
C:\Dev\qt5\qtbase\lib\libQt5DBus.a
C:\Dev\qt5\qtbase\lib\libQt5Test.a
C:\Dev\qt5\qtbase\lib\libQt5Widgets.a
C:\Dev\qt5\qtbase\lib\libQt5Gui.a
C:\Dev\qt5\qtbase\lib\libqtlibpng.a
C:\Dev\qt5\qtbase\lib\liblibEGL.a
C:\Dev\qt5\qtbase\lib\liblibGLESv2.a
C:\Dev\qt5\qtbase\lib\libtranslator.a
C:\Dev\qt5\qtbase\lib\libpreprocessor.a
C:\Dev\qt5\qtbase\lib\libqtharfbuzz.a
C:\Dev\qt5\qtbase\lib\libQt5Xml.a
C:\Dev\qt5\qtbase\lib\libQt5Sql.a
C:\Dev\qt5\qtbase\lib\libQt5Network.a
C:\Dev\qt5\qtbase\lib\libqtmain.a
C:\Dev\qt5\qtbase\lib\libQt5Core.a
C:\Dev\qt5\qtbase\lib\libqtpcre2.a
C:\Dev\qt5\qtbase\lib\libQt5Bootstrap.a
C:\Dev\qt5\qtwebengine\src\3rdparty\chromium\ppapi\native_client\src\untrusted\irt_stub\libppapi.a
C:\Dev\qt5\qtwebengine\src\3rdparty\chromium\third_party\breakpad\breakpad\src\client\mac\gcov\libgcov.a
C:\Dev\qt5\qtbase\tests\auto\corelib\io\qdir\types\c.a
C:\Dev\qt5\qtbase\tests\auto\corelib\io\qdir\types\b.a
C:\Dev\qt5\qtbase\tests\auto\corelib\io\qdir\types\a.a
C:\Dev\qt5\qtbase\tests\auto\corelib\io\qdir\types\f.a
C:\Dev\qt5\qtbase\tests\auto\corelib\io\qdir\types\e.a
C:\Dev\qt5\qtbase\tests\auto\corelib\io\qdir\types\d.a
I gave up so I posted here.
May be someone ran across this issue before, and could share his solution or workaround.
TIA.
Maybe a lower version of MinGW will work.
You could find the toolchains used in Qt binary packages in this page:https://wiki.qt.io/MinGW.

how to make loadable kernel module on solaris? no linux

1. how to create loadable kernel module on solaris 11?
simple loadable kernel module (hello world).
I searched, but only showed how to create a Linux kernel module.
in linux, header linux/kernel.h, but not included header on solaris
2. how to compile loadable kernel module on solaris 11?
gcc -D_KERNEL -m64 -c cpluscplus.cpp
Is it appropriate to compile as above?
64bit, x86
Here's the minimal hello world kernel module I can come up with:
#include <sys/modctl.h>
#include <sys/cmn_err.h>
/*
* Module linkage information for the kernel.
*/
static struct modlmisc modlmisc = {
&mod_miscops, "test module"
};
static struct modlinkage modlinkage = {
MODREV_1, (void *)&modlmisc, NULL
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}
int
_info(struct modinfo *modinfop)
{
cmn_err(CE_NOTE, "hello kernel");
return (mod_info(&modlinkage, modinfop));
}
Compiling this as 64-bit binary with Oracle Developer Studio 12.6 and the Solaris linker like so:
cc -D_KERNEL -I include -m64 -c foomod.c
ld -64 -z type=kmod -znodefs -o foomod foomod.o
For GCC you will likely need a distinct set of options.
Then load it with:
modload ./foomod
This will complain about signature verification. This is innocuous unless you are running the system with Verified Boot enabled.
Check that module is loaded:
# modinfo -i foomod
ID LOADADDR SIZE INFO REV NAMEDESC
312 fffffffff7a8ddc0 268 -- 1 foomod (test module)
# dmesg | tail -1
Mar 16 12:22:57 ST091 foomod: [ID 548715 kern.notice] NOTICE: hello kernel
This works on Solaris 11.4 SRU 33 running on x86 machine (VirtualBox instance in fact).

QT powershell error windows-build-qt-static.ps1

After 6-7 attempts to compile QT static version i used this article Building_a_static_Qt_for_Windows_using_MinGW
and again errors:
I have installed QT 5.7.
I downloaded
windows-build-qt-static.ps1 then changing the necessary lines
[CmdletBinding()]
param(
$QtSrcUrl = "https://download.qt.io/snapshots/qt/5.8/5.8.0/latest_src/qt-everywhere-opensource-src-5.8.0.7z",
$QtStaticDir = "C:\Qt\Static",
$QtVersion = "5.7",
$MingwDir = "C:\Qt\Tools\mingw530_32\bin\gcc.exe",
[switch]$NoPause = $false
)
and the error is
Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.
PS C:\Users\Admin> C:\Qt\windows-build-qt-static.ps1
Building static Qt version 5.7
Using MinGW from C:\Qt\Tools\mingw530_32\bin\gcc.exe
Downloading https://download.qt.io/snapshots/qt/5.8/5.8.0/latest_src/qt-everywhere-opensource-src-5.8.0.7z ...
Expanding C:\Qt\Static\src\qt-everywhere-opensource-src-5.8.0.7z ...
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
Scanning the drive for archives:
1 file, 353390329 bytes (338 MiB)
--
Path = C:\Qt\Static\src\qt-everywhere-opensource-src-5.8.0.7z
Type = 7z
Physical Size = 353390329
Headers Size = 1959904
Method = LZMA2:24
Solid = +
Blocks = 1
Everything is Ok
Folders: 17053
Files: 155016
Size: 1670093035
Compressed: 353390329
Patching C:\Qt\Static\src\qt-everywhere-opensource-src-5.8.0\qtbase\mkspecs\win32-g++\qmake.conf ...
+ cd qtbase
+ C:\Qt\Static\src\qt-everywhere-opensource-src-5.8.0\qtbase\configure.bat -top-level -static -debug-and-release -platfo
rm win32-g++ -prefix C:\Qt\Static\5.7 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-
sql-sqlite -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake te
sts
Please wait while bootstrapping configure ...
Perl not found in PATH. Aborting.
mingw32-make : The term 'mingw32-make' is not recognized as the name of a cmdlet, function, script file, or operable pr
ogram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Qt\windows-build-qt-static.ps1:170 char:5
+ mingw32-make -k -j4
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (mingw32-make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
mingw32-make : The term 'mingw32-make' is not recognized as the name of a cmdlet, function, script file, or operable pr
ogram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Qt\windows-build-qt-static.ps1:171 char:5
+ mingw32-make -k install
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (mingw32-make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Out-File : Could not find a part of the path 'C:\Qt\Static\5.7\mkspecs\win32-g++\qmake.conf'.
At C:\Qt\windows-build-qt-static.ps1:178 char:6
+ "# | Out-File -Append $File -Encoding Ascii
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], DirectoryNotFoundException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
Please wait while bootstrapping configure ...
Perl not found in PATH. Aborting.
mingw32-make : The term 'mingw32-make' is not r .....
Out-File : Could not find a part of the path 'C:\Qt\Static\5.7\mkspecs\win32-g++\qmake.conf'.
At C:\Qt\windows-build-qt-static.ps1:178 char:6
+ "# | Out-File -Append $File -Encoding Ascii
This windows-build-qt-static.ps1 script worked for me a year ago.
Note at line 117, I just removed one * from path C:\Qt\Tools\mingw*\bin\gcc.exe between Qt\ and Tools
#-----------------------------------------------------------------------------
#
# Copyright (c) 2013-2015, Thierry Lelegard
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#
#-----------------------------------------------------------------------------
<#
.SYNOPSIS
Build a static version of Qt for Windows.
.DESCRIPTION
This scripts downloads Qt source code, compiles and installs a static version
of Qt. It assumes that a prebuilt Qt / MinGW environment is already installed,
typically in C:\Qt. This prebuilt environment uses shared libraries. It is
supposed to remain the main development environment for Qt. This script adds
a static version of the Qt libraries in order to allow the construction of
standalone and self-sufficient executable.
This script is typically run from the Windows Explorer.
Requirements:
- Windows PowerShell 3.0 or higher.
- 7-zip.
.PARAMETER QtSrcUrl
URL of the Qt source file archive.
By default, use the latest identified version.
.PARAMETER QtStaticDir
Root directory where the static versions of Qt are installed.
By default, use C:\Qt\Static.
.PARAMETER QtVersion
The Qt version. By default, this script tries to extract the version number
from the Qt source file name.
.PARAMETER MingwDir
Root directory of the MinGW prebuilt environment. By default, use the version
which was installed by the prebuilt Qt environment.
.PARAMETER NoPause
Do not wait for the user to press <enter> at end of execution. By default,
execute a "pause" instruction at the end of execution, which is useful
when the script was run from Windows Explorer.
#>
[CmdletBinding()]
param(
$QtSrcUrl = "http://download.qt.io/official_releases/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.7z",
$QtStaticDir = "C:\Qt\Static",
$QtVersion = "",
$MingwDir = "",
[switch]$NoPause = $false
)
# PowerShell execution policy.
Set-StrictMode -Version 3
#-----------------------------------------------------------------------------
# Main code
#-----------------------------------------------------------------------------
function Main
{
# Check that 7zip is installed. We use it to expand the downloaded archive.
[void] (Get-7zip)
# Get Qt source file name from URL.
$QtSrcFileName = Split-Path -Leaf $QtSrcUrl
# If Qt version is not specified on the command line, try to extract the value.
if (-not $QtVersion) {
$QtVersion = $QtSrcFileName -replace "`.[^`.]*$",''
$QtVersion = $QtVersion -replace 'qt-',''
$QtVersion = $QtVersion -replace 'everywhere-',''
$QtVersion = $QtVersion -replace 'opensource-',''
$QtVersion = $QtVersion -replace 'src-',''
$QtVersion = $QtVersion -replace '-src',''
}
Write-Output "Building static Qt version $QtVersion"
# Qt installation directory.
$QtDir = "$QtStaticDir\$QtVersion"
# Get MinGW root directory, if not specified on the command line.
if (-not $MingwDir) {
# Search all instances of gcc.exe from C:\Qt prebuilt environment.
$GccList = #(Get-ChildItem -Path C:\Qt\Tools\mingw*\bin\gcc.exe | ForEach-Object FullName | Sort-Object)
if ($GccList.Length -eq 0) {
Exit-Script "MinGW environment not found, no Qt prebuilt version?"
}
$MingwDir = (Split-Path -Parent (Split-Path -Parent $GccList[$GccList.Length - 1]))
}
Write-Output "Using MinGW from $MingwDir"
# Build the directory tree where the static version of Qt will be installed.
Create-Directory $QtStaticDir\src
Create-Directory $QtDir
# Download the Qt source package if not yet done.
Download-File $QtSrcUrl $QtStaticDir\src\$QtSrcFileName
# Directory of expanded packages.
$QtSrcDir = "$QtStaticDir\src\$((Get-Item $QtStaticDir\src\$QtSrcFileName).BaseName)"
# Expand archives if not yet done
Expand-Archive $QtStaticDir\src\$QtSrcFileName $QtStaticDir\src $QtSrcDir
# Patch Qt's mkspecs for static build.
$File = "$QtSrcDir\qtbase\mkspecs\win32-g++\qmake.conf"
if (-not (Select-String -Quiet -SimpleMatch -CaseSensitive "# [QT-STATIC-PATCH]" $File)) {
Write-Output "Patching $File ..."
Copy-Item $File "$File.orig"
#"
# [QT-STATIC-PATCH]
QMAKE_LFLAGS += -static -static-libgcc
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer
DEFINES += QT_STATIC_BUILD
"# | Out-File -Append $File -Encoding Ascii
}
# Set a clean path including MinGW.
$env:Path = "$MingwDir\bin;$MingwDir\opt\bin"
# Force English locale to avoid weird effects of tools localization.
$env:LANG = "en"
# Set environment variable QT_INSTALL_PREFIX. Documentation says it should be
# used by configure as prefix but this does not seem to work. So, we will
# also specify -prefix option in configure.
$env:QT_INSTALL_PREFIX = $QtDir
# Configure, compile and install Qt.
Push-Location $QtSrcDir
& $env:SystemRoot\System32\cmd.exe /c "configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir `
-qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl `
-opensource -confirm-license `
-make libs -nomake tools -nomake examples -nomake tests"
mingw32-make -k -j4
mingw32-make -k install
Pop-Location
# Patch Qt's installed mkspecs for static build of application.
$File = "$QtDir\mkspecs\win32-g++\qmake.conf"
#"
CONFIG += static
"# | Out-File -Append $File -Encoding Ascii
Exit-Script
}
#-----------------------------------------------------------------------------
# A function to exit this script. The Message parameter is used on error.
#-----------------------------------------------------------------------------
function Exit-Script ([string]$Message = "")
{
$Code = 0
if ($Message -ne "") {
Write-Output "ERROR: $Message"
$Code = 1
}
if (-not $NoPause) {
pause
}
exit $Code
}
#-----------------------------------------------------------------------------
# Silently create a directory.
#-----------------------------------------------------------------------------
function Create-Directory ([string]$Directory)
{
[void] (New-Item -Path $Directory -ItemType "directory" -Force)
}
#-----------------------------------------------------------------------------
# Download a file if not yet present.
# Warning: If file is present but incomplete, do not download it again.
#-----------------------------------------------------------------------------
function Download-File ([string]$Url, [string]$OutputFile)
{
$FileName = Split-Path $Url -Leaf
if (-not (Test-Path $OutputFile)) {
# Local file not present, start download.
Write-Output "Downloading $Url ..."
try {
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile($Url, $OutputFile)
}
catch {
# Display exception.
$_
# Delete partial file, if any.
if (Test-Path $OutputFile) {
Remove-Item -Force $OutputFile
}
# Abort
Exit-Script "Error downloading $FileName"
}
# Check that the file is present.
if (-not (Test-Path $OutputFile)) {
Exit-Script "Error downloading $FileName"
}
}
}
#-----------------------------------------------------------------------------
# Get path name of 7zip, abort if not found.
#-----------------------------------------------------------------------------
function Get-7zip
{
$Exe = "C:\Program Files\7-Zip\7z.exe"
if (-not (Test-Path $Exe)) {
$Exe = "C:\Program Files (x86)\7-Zip\7z.exe"
}
if (-not (Test-Path $Exe)) {
Exit-Script "7-zip not found, install it first, see http://www.7-zip.org/"
}
$Exe
}
#-----------------------------------------------------------------------------
# Expand an archive file if not yet done.
#-----------------------------------------------------------------------------
function Expand-Archive ([string]$ZipFile, [string]$OutDir, [string]$CheckFile)
{
# Check presence of expected expanded file or directory.
if (-not (Test-Path $CheckFile)) {
Write-Output "Expanding $ZipFile ..."
& (Get-7zip) x $ZipFile "-o$OutDir" | Select-String -Pattern "^Extracting " -CaseSensitive -NotMatch
if (-not (Test-Path $CheckFile)) {
Exit-Script "Error expanding $ZipFile, $OutDir\$CheckFile not found"
}
}
}
#-----------------------------------------------------------------------------
# Execute main code.
#-----------------------------------------------------------------------------
. Main

Shiny-server does not show rmarkdown even in the example page (rmarkdown package installed)

I installed a shiny-server on Amazon AWS EC-2 (Amazon Linux AMI 2015.09.1 (HVM), SSD Volume Type - ami-60b6c60a). The server works fine for the Shiny apps, but does not render the .rmd, even the rmd from the example page.
I only see this error:
Error: error in running command
In the HTML:
<div id="__reactivedoc__" class="shiny-html-output shiny-bound-output shiny-output-error">error in running command</div>
I already installed the rmarkdown package, it works fine on Rstudio. (I use the same user for Rstudio and Shiny server).
I don't know how to get more information about the error, I don't see other messages.
Somebody have an idea?
NEW INFO:
I investigate the logs from the server:
This is the output from the /var/log/shiny-server/:
su: ignore --preserve-environment, it's mutually exclusive to --login.
Listening on http://127.0.0.1:52294
/opt/shiny-server/ext/pandoc/pandoc: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
Warning: Error in system: error in running command
Stack trace (innermost first):
97: system
96: force
95: with_pandoc_safe_environment
94: get_pandoc_version
93: FUN
92: lapply
91: find_pandoc
90: pandoc_available
89: <Anonymous>
88: do.call
87: contextFunc
86: .getReactiveEnvironment()$runWith
85: shiny::maskReactiveContext
84: reactive reactive({
out <- rmd_cached_output(file, encoding)
output_dest <- out$dest
if (out$cached) {
if (nchar(out$resource_folder) > 0) {
shiny::addResourcePath(basename(out$resource_folder),
out$resource_folder)
}
return(out$shiny_html)
}
if (!file.exists(dirname(output_dest))) {
dir.create(dirname(output_dest), recursive = TRUE, mode = "0700")
}
resource_folder <- knitr_files_dir(output_dest)
perf_timer_reset_all()
dependencies <- list()
shiny_dependency_resolver <- function(deps) {
dependencies <<- deps
list()
}
output_opts <- list(self_contained = FALSE, copy_resources = TRUE,
dependency_resolver = shiny_dependency_resolver)
message("\f")
args <- merge_lists(list(input = reactive_file(), output_file = output_dest,
output_dir = dirname(output_dest), output_options = output_opts,
intermediates_dir = dirname(output_dest), runtime = "shiny"),
render_args)
result_path <- shiny::maskReactiveContext(do.call(render,
args))
if (!dir_exists(resource_folder))
dir.create(resource_folder, recursive = TRUE)
shiny::addResourcePath(basename(resource_folder), resource_folder)
dependencies <- append(dependencies, list(create_performance_dependency(resource_folder)))
write_deps <- base::file(file.path(resource_folder, "shiny.dep"),
open = "wb")
on.exit(close(write_deps), add = TRUE)
serialize(dependencies, write_deps, ascii = FALSE)
if (!isTRUE(out$cacheable)) {
shiny::onReactiveDomainEnded(shiny::getDefaultReactiveDomain(),
function() {
unlink(result_path)
unlink(resource_folder, recursive = TRUE)
})
}
shinyHTML_with_deps(result_path, dependencies)
})
73: doc
72: shiny::renderUI
71: func
70: output$__reactivedoc__
3: <Anonymous>
2: do.call
1: rmarkdown::run
On the /opt/shiny-server/ext/pandoc/ I have these:
-rwxrwxr-x 1 root root 37191008 Feb 3 2014 pandoc
-rwxrwxr-x 1 root root 38520576 Feb 3 2014 pandoc-citeproc
drwxrwxr-x 2 root root 4096 Jan 13 15:15 static
I tried to install "gmp.x86_64", but the results are:
> yum install gmp.x86_64
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
epel/x86_64/metalink | 3.0 kB 00:00
epel/x86_64 | 4.3 kB 00:00 ...
epel/x86_64/updateinfo | 715 kB 00:00
epel/x86_64/primary_db | 5.8 MB 00:01
949 packages excluded due to repository priority protections
Package gmp-6.0.0-11.16.amzn1.x86_64 already installed and latest version
Nothing to do
And still not working.... Maybe there is another package?
In my "/usr/lib64/" I have libgmp.so.10.2.0, but I think I don't have libgmp.so.3.
Even installing the i686 version, still the same.
For Fedora 23 I had the same problem
[root#pjux shiny-server]# ldd -d /opt/shiny-server/ext/pandoc/pandoc
linux-vdso.so.1 (0x00007ffff9eb0000)
libz.so.1 => /lib64/libz.so.1 (0x00007fc20bd55000)
librt.so.1 => /lib64/librt.so.1 (0x00007fc20bb4d000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fc20b949000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc20b745000)
libgmp.so.3 => not found
libffi.so.5 => not found
libm.so.6 => /lib64/libm.so.6 (0x00007fc20b442000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc20b081000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc20ae63000)
/lib64/ld-linux-x86-64.so.2 (0x0000561bb7c14000)
but
ln -s /lib64/libffi.so.6.0.2 /lib64/libffi.so.5
ln -s /lib64/libgmp.so.10.2.0 /lib64/libgmp.so.3
solved it
I solved the problem with help from the github issues page of shiny-server
How sjpascual said, just install the packages: compat-gmp4 and compat-libffi5 to fix it.
Now is working fine.
This is an old post but in case someone has a similar problem. You may try to install the RMarkdown package from console as root instead of inside RStudio to make the package available to the Shiny server:
sudo su - -c "R -e \"install.packages('rmarkdown', repos='http://cran.rstudio.com/')\""
That helped me to get the RMarkdown sample app in the test page to load...
For CentOS 7, installing gmp-devel and libffi-devel and restarting Shiny Server resolved the issue.

in middle of installation qt-everywhere show me this error:

..........................g++ -o
"/opt/qt-everywhere-opensource-src-4.7.0/bin/qmake" project.o
property.o main.o makefile.o unixmake2.o unixmake.o mingw_make.o
option.o winmakefile.o projectgenerator.o meta.o makefiledeps.o
metamakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o
msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o
msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o
symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o
qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o
qglobal.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o
qlist.o qfile.o qfsfileengine_unix.o qfsfileengine_iterator_unix.o
qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o
qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o
qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o
qmap.o qmetatype.o qsettings.o qlibraryinfo.o qvariant.o qvsnprintf.o
qlocale.o qlinkedlist.o qurl.o qnumeric.o qcryptographichash.o
qxmlstream.o qxmlutils.o
The target system byte order could not be detected! Turn on verbose
messaging (-v) to see the final report. You can use the -little-endian
or -big-endian switch to ./configure to continue.
I have fedora 21 version 32 bit. and my system is little endian when i write lscpu in command line. but now i don't know what can i type to continue configuration
what is this meaning last paragraph?what can i do know?
help me please
this is my command line :
echo yes | ./configure -prefix /opt/Qt4.7 -opensource -embedded arm -xplatform qws/linux-arm-g++ -no-webkit -qt-libtiff -qt-libmng -qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp -no-neon
remove all files type "*.o" from qmake folder in qt folder. then run configure command again

Resources