Is no-asm option while building openssl discouraged? - compilation

I am looking at some old code in the product i am working on and it seems they have used no-asm option while compiling openssl. I read that with assembly routines openssl can perform faster. Then why using assembly subroutines while compiling openssl is discouraged. Is it related to FIPS guidelines?

Related

changing compiler library standards on ubuntu

I am compiling one code repository which has a makefile,
make INSTALL_PREFIX=/usr/local install
and I get the following error:
This file requires compiler and library support for the ISO C++ 2011
standard. This support must be enabled with the -std=c++11 or
-std=gnu++11 compiler options.
How can I enable ISO C++ 2011 standard?
Thanks,
You don't give any details on the code repository, does it use just a standard makefile, autotools, cmake ?
You may be able to just do a export CPPFLAGS="-std=c++11" prior to building building the code.

How can I build a DLL using the OpenSSL FIPS static library on Windows?

I asked this on the openssl-users mailing list with no replies, so I thought I'd try here.
I am trying to build a Windows DLL that includes the static OpenSSL FIPS libraries. I built the FIPS libraries using perl Configure fips --with-fipslibdir=... -no-shared and then nmake -f ms\nt.mak. I'm using openssl-fips-2.0.5, openssl-1.0.1j, and MS Visual Studio 2010.
Now I'm trying to link the resulting libraries into my DLL. I've followed the instructions in the OpenSSL FIPS 2.0 User's Guide, setting a bunch of environment variables (FIPS_LINK, FIPS_CC, FIPS_CC_ARGS, etc.) and then called fipslink.pl. But I'm getting a "First stage Link failure".
It reports "Integrity check OK" and then compiles fips_premain.c, but when linking the DLL I get a bunch of "locally defined symbol _time64 imported" warnings (as well as strncmp, _errno, abort, fprintf, and others), and then some unresolved external symbols including:
__imp_strncpy
__imp_qsort
__imp_wcsstr
__imp_vsnwprintf
All of the errors come from libeayfips32.lib, libeaycompat32.lib, and ssleay32.lib.
I've played around with adding and removing things like /NODEFAULTLIB:msvcrt and /NODEFAULTLIB:libcmtd, and building with /MT or /MD or neither, but I keep getting linker errors each time. What am I missing?
I speculate that the "-no-shared" switch to the Configure script statically links the C standard library. You'd get your static OpenSSL FIPS library, but it would include implementations of printf and friends, as you actually experience.
open file ms\nt.mak then modify line #28 by adding msvcrt.lib msvcrtd.lib at the end , to be like:
EX_LIBS=ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib msvcrt.lib msvcrtd.lib
then run : nmake -f ms\nt.mak from visual studio command prompt.I hope that no linker messages will appear.
Also try to build the DLL by nmake -f ms\ntdll.mak

Building OpenSSL on Win32, with zlib

I'm trying to build Open SSL on Windows using VS 2013, with ZLIB support.
I follow the instructions this way:
perl Configure VC-WIN32 --prefix="D:\work_local\openssl\openssl-1.0.1h\redist" no-asm zlib no-shared
ms\do_ms
nmake -f ms\ntdll.mak
Now I get linker error, saying zlib1.lib is not found.
What is surprising, is that it didn't complain about not finding zlib.h.
So how do I pass ZLIB include and LIB path while building OpenSSL on Windows?
You need to add --with-zlib-include=[path to zlib headers] --with-zlib-lib=[path to zlib static library]

Haskell package missing c library

I'm having trouble building the hmatrix library on OS X Lion. Looking at the .cabal file, it requires the gsl library, so I installed it with macports. The .a files are in /opt/local/lib and the .h files are in /opt/local/include/gsl
As suggested here I changed the built-type from Custom to Simple. (without that change I get a similar error).
When I use cabal configure I get the following output:
* Missing C library: gsl
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
So I tried cabal --extra-include-dirs=/opt/local/include --extra-lib-dirs=/opt/local/lib configure, but I still get the same error. I can compile and link a c program that includes gsl. What files is cabal looking for? If I have the right files, how do I tell it how to find them?
libgsl.a is a universal binary:
$ file /opt/local/lib/libgsl.a
/opt/local/lib/libgsl.a: Mach-O universal binary with 2 architectures
/opt/local/lib/libgsl.a (for architecture x86_64): current ar archive random library
/opt/local/lib/libgsl.a (for architecture i386): current ar archive random library
ghc looks like it's 64-bit:
$ ghc --info
[("Project name","The Glorious Glasgow Haskell Compilation System")
,("GCC extra via C opts"," -fwrapv")
,("C compiler command","/usr/bin/llvm-gcc")
,("C compiler flags"," -m64 -fno-stack-protector -m64")
,("ar command","/usr/bin/ar")
,("ar flags","clqs")
,("ar supports at file","NO")
,("touch command","touch")
,("dllwrap command","/bin/false")
,("windres command","/bin/false")
,("perl command","/usr/bin/perl")
,("target os","OSDarwin")
,("target arch","ArchX86_64")
,("target word size","8")
,("target has GNU nonexec stack","False")
,("target has subsections via symbols","True")
,("Project version","7.4.2")
,("Booter version","7.4.2")
,("Stage","2")
,("Build platform","x86_64-apple-darwin")
,("Host platform","x86_64-apple-darwin")
,("Target platform","x86_64-apple-darwin")
,("Have interpreter","YES")
,("Object splitting supported","NO")
,("Have native code generator","YES")
,("Support SMP","YES")
,("Unregisterised","NO")
,("Tables next to code","YES")
,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn")
,("Leading underscore","YES")
,("Debug on","False")
,("LibDir","/usr/local/Cellar/ghc/7.4.2/lib/ghc-7.4.2")
,("Global Package DB","/usr/local/Cellar/ghc/7.4.2/lib/ghc-7.4.2/package.conf.d")
,("Gcc Linker flags","[\"-m64\"]")
,("Ld Linker flags","[\"-arch\",\"x86_64\"]")
]
As an alternative to mac-ports you can use the nix package manager for mac. It does a pretty good job of taking care of the c dependancies for for the libraries available through it. In general I have been more happy with it then any other package manager on mac.
Unfortunately mac(darwin) unlike for linux does not have as many binaries available through nix so installing ghc often means waiting for it to compile.
The commands to install ghc and hmatrix after installation of nix are:
nix-env -iA nixpkgs-unstable.haskellPackages.ghc
nix-env -iA nixpkgs-unstable.haskellPackages.hmatrix
All of the needed dependencies will be taken care of for you.
I just tried it on my macbook pro and hmatrix seems to be working correctly in ghci after trying commands from the first few pages of the tutorial.
I'm not a mac person, but it really sounds like you haven't installed the "-dev" version. For a mac, I suspect you need to install gsl-devel in addition to gsl. If the problem persists, verify that you have libgsl0-dev on your library path.

How to build Boost Libraries for Code Warrior IDE (v5.7) for RVDS 3.0?

I am using Boost.Regex library to write a code for 10 digit mobile no. verification.I have compiled the Boost library using bjam.exe for msvc.
Now I want to run the same code for a BREW handset.For generating the executable (mod file) for the handset, I compile the C++ code using RVDS 3.0.The IDE used is Code Warrior 5.7
Can any body please tell me the way to compile boost library for RVDS 3.0.I am using armcc compiler.
You might want to rebuild the boost libraries with the appropriate compiler set to --toolset parameter of bjam. Here is the bjam reference: Boost Jam

Resources