[omniORB] omni make error

Brian Brooks (US) Brian.Brooks at datapath.com
Fri Mar 27 13:40:01 GMT 2015


The root cause may be cygwin’s link is appearing before Microsoft Visual Studio’s link…



Here are the steps I use to build omniORB with vs2008.

  1.  Open a DOS prompt.
  2.  Type vcvars32 to setup access to cl.exe, the Microsoft compiler.
  3.  Now that the environment variables are set in this DOS window, fork a child DOS window that is a cygwin window
  c:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -
  4.  Edit /etc/profile to re-order the default cygwin path so that Microsoft's Visual Studio link.exe will appear in the path before /usr/bin/link.
vi /etc/profile
change from
PATH="/usr/local/bin:/usr/bin${PATH:+:${PATH}}"
to
PATH="${PATH:+:${PATH}}:/usr/local/bin:/usr/bin:/bin"
Note that in addition to the reordering a : (colon) path seprator was added between ${PATH:${PATH}} and  /usr/local/bin.  Also /bin was added to path.
  5.  Exit this cygwin session and restart a new one.
  6.  $ exit
c:>  C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -
  7.  Verify that Microsoft's Visual Studio link.exe appears first in the PATH:
$ which link
/cygdrive/c/rw_apps/Program Files (x86)/Microsoft Visual Studio 9.0/VC/BIN/link

8.       For completeness, here is the complete set of instructions I follow to use vs2008 to build 32-bit omniORB with the SSL transport enabled on Windows 7 64-bit Cygwin...



For completeness, here is the complete set of instructions I follow to use vs2008 to build 32-bit omniORB with the SSL transport enabled on Windows 7 64-bit Cygwin.  These steps are somewhat specific to our product’s build environment.  Our product is primarily a Java product built with Apache maven but we have some C and C++ components.  In addition to maven, you’ll see gradle referenced which is a recent experimental addition to our build setup.



Beware some times I’ve experienced introduction of weird white-space when copy and pasting the steps around step #15 that caused the filenames get generated incorrectly.  I’m guessing it had something to do with copying and pasting into a Cygwin terminal window on a windows machine, crossing character encodings.


Building omniORB 4.1.7 on Windows Microsoft Visual Studio 2008
omniORB calls MSVC++ 2008 "vs9".

  1.  Setup the build environment with maven and gradle.
  2.  Build MaxView
mvn clean install
  3.  Install MSVC++ 2008.
  4.  Install cygwin.
     *   Install cygwin Devel/make 3.x or 4.x
     *   Install cygwin Devel/patch 2.7.x
  5.  Install python 2.x.  3.x broke a lot of python scripts, so avoid for omniORB 4.1.7.
  6.  Open a DOS prompt.
  7.  Type vcvars32 to setup access to cl.exe, the Microsoft compiler.
  8.  Now that the environment variables are set in this DOS window, fork a child DOS window that is a cygwin window
  c:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -
  9.  Edit /etc/profile to re-order the default cygwin path so that Microsoft's Visual Studio link.exe will appear in the path before /usr/bin/link.
vi /etc/profile
change from
PATH="/usr/local/bin:/usr/bin${PATH:+:${PATH}}"
to
PATH="${PATH:+:${PATH}}:/usr/local/bin:/usr/bin:/bin"
Note that in addition to the reordering a : (colon) path seprator was added between ${PATH:${PATH}} and  /usr/local/bin.  Also /bin was added to path.
  10. Exit this cygwin session and restart a new one.
  11. $ exit
c:>  C:\rw_apps\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -
  12. Verify that Microsoft's Visual Studio link.exe appears first in the PATH:
$ which link
/cygdrive/c/rw_apps/Program Files (x86)/Microsoft Visual Studio 9.0/VC/BIN/link
  13. Download omniORB-4.1.7.tar.bz2.
  14. In a cygwin shell, bunzip2 omniORB-4.1.7.tar.bz2
  15. Build omniORB from source
     *   Prepare the raw patch with your MAVEN_LOCAL_REPO environment variable value.
        *   export MAXVIEW_SRC=/cygdrive/c/dev/mvtrunk
        *   cd $MAXVIEW_SRC/thirdparty/omniORB/win32
        *   Check that the cooked patch filename in the next section, still matches the omniORB version specified in trunk/pom.xml.  If they're different, edit filename in these wiki instructions prior to executing the commands.
        *   Then execute these commands.
# Get ready to build by creating the patch working folder
mkdir -p target/cooked-patches
# using cygpath --mixed which is like --windows, but with regular slashes (C:/WINNT)
# This path will eventually be passed to the MSVC++ console applications
# cl.exe and link.exe; these apps will want a path like c:/ (--mixed) rather than /cygdrive/c (--unix).
TEMP1=`cygpath --mixed "$MAVEN_LOCAL_REPO"`
# sed tips
# s means search and replace
# | means literal whereas / means regular expression
cat src/main/patches/omniORB-4.1.7-set-vs-py-openssl_raw.patch | sed 's|REPLACE_WITH_MAVEN_LOCAL_REPO|'"$TEMP1"'|' > target/cooked-patches/omniORB-4.1.7-2-set-vs-py-openssl_cooked.patch
     *   In a cygwin shell to preserve original line endings
  tar xvf omniORB-4.1.7.tar
This should create $trunk_src/thirdparty/omniORB/win32/omniORB-4.1.7.
     *   In a cygwin shell, run these commands in order to get omniORB ready to build on MSVC++ 2008 with OpenSSL support.
# update patch file again, this time with third party version numbers from trunk pom.xml
# and also patch the makefiles in the extracted omniORB source tarball
mvn process-resources
     *   Verify that the output contains a line like
[INFO] --- maven-patch-plugin:1.1.1:apply (patch) @ omniORB ---
[INFO] Applying patch: omniORB-4.1.7-1-set-vs-py-openssl_cooked.patch
output like the following means the patching failed...
[INFO] --- maven-patch-plugin:1.1.1:apply (patch) @ omniORB ---
[INFO] Skipping patch: omniORB-4.1.7-2-set-vs-py-openssl_cooked.patch listed in the parameter "patches"; it is missing.​

     *   Now build omniORB..
     *   cd omniorb-4.1.7/src
make export
     *   Build takes about 10 minutes on a fast laptop with Intel i7-3720QM CPU @ 2.60GHz, Windows 7 64-bit, 8GB memory, solid state drive.
     *   If a failure occurs and you try to re-run without re-extracting the source from TAR, you'll get strange errors like:
make[3]: *** No rule to make target '/c/python26/include/Python.h', needed by 'idlpython.o'.  Stop.
So if you encouter a build failure start back over with at the top of the "Build omniORB from source" steps.
So to correct a failure you must:

        *   ​​Run mvn clean.
        *   Re-extract the TAR file.
        *   Correct any errors.
        *   Repeat all the steps in this section again to re-create the cooked patch and re-apply the cooked patch to the omniORB source.
        *   Try building omniORB again.
     *   If all goes well:

        *   The executables and DLLs will be installed into
 trunk_src/thirdparty/omniORB/omniORB-4.1.7/bin/x86_win32/
        *   The libraries will be installed into
  trunk_src/thirdparty/omniORB/omniORB-4.1.7/lib/x86_win32/
  1.  Setup gradle and and setup maven repo setting by creating a gradle.properties file in $HOME.
     *   Download gradle and install it.
     *   mkdir $HOME/.gradle
     *   vi $HOME/.gradle/gradle.properties
     *   Put the following in gradle.properties
# http://www.gradle.org/docs/current/userguide/build_environment.html
# http://stackoverflow.com/questions/12749225/where-to-put-gradle-configuration-i-e-credentials-that-should-not-be-committe
mavenUser=your-artifactory-user
mavenPassword=your-artifactory-password

# speed up gradle
# http://stackoverflow.com/questions/17324849/android-studio-gradle-build-speed-up
org.gradle.daemon=true
  2.  If applicable, rev the omniORB version

     *   Edit trunk_src/thirdparty/omniORB​/build.gradle
     *   Change the appropriate version property values e.g.​
omniORB_version_major=4
omniORB_version_minor=1.7
omniORBmaxview_package_version=2
  1.  From the trunk_src/thirdparty/omniORB folder, execute 'gradle publish'.
  2.  Update the omniORB version in the maven trunk_src/pom.xml to match the build.gradle setting.
  3.  Update the omniORB version in Visual Studio project files (trunk_src/msvc-global.vsprops and .vcproj) for app1, app2, and lib1.
Reference

http://jungels.net/articles/diff-patch-ten-minutes.html



Here’s the current patch I use to target OpenSSL-FIPS 1.0.1L.  This patch is applied in step #15.  We store the patch here src/main/patches/omniORB-4.1.7-set-vs-py-openssl_raw.patch.



C:\dev\mvtrunk\thirdparty\omniORB\win32>svn propset svn:keywords "Id" src\main\patches\omniORB-4.1.7-set-vs-py-openssl_raw.patch

property 'svn:keywords' set on 'src\main\patches\omniORB-4.1.7-set-vs-py-openssl_raw.patch'



C:\dev\mvtrunk\thirdparty\omniORB\win32>svn status

?       omniORB-4.1.7

?       omniORB-4.1.7.orig

MM      src\main\patches\omniORB-4.1.7-set-vs-py-openssl_raw.patch



C:\dev\mvtrunk\thirdparty\omniORB\win32>



$Id: omniORB-4.1.7-set-vs-py-openssl_raw.patch 69281 2015-03-16 16:43:27Z Brian.Brooks $



This patch:

1. Edits <top>\config\config.mk to set MSVC++ 2008

  platform = x86_win32_vs_9

2. Edits <top>\mk\platforms\x86_win32_vs_9 to set PYTHON and OPEN_SSL_ROOT paths.

3. In sslContext.cc force OpenSSL FIPS_mode_set ON.

4. RSA key exchange is not a FIPS approved algorithm which prevented

the omniORB 4.1.x SSL transport initialization to fail when

OpenSSL is run with FIPS mode enabled.  Fix by backporting an omniORB 4.2.0 change

to disable set_ephemeralRSA.

http://sourceforge.net/p/omniorb/svn/6101/

Revision: 6101

Author: dgrisby

Date: Tuesday, August 14, 2012 5:54:26 AM

Message:

No longer set low-grade ephemeral RSA keys. Fix SSL example error messages.

----

Modified : /trunk/omniORB/src/lib/omniORB/orbcore/ssl/sslContext.cc



History:

02/03/2015 BEB  Added changes to sslContext.cc for OpenSSL FIPS_mode_set.

04/29/2014 BEB  Created.



diff -rupN omniORB-4.1.7.orig/config/config.mk omniORB-4.1.7/config/config.mk

--- omniORB-4.1.7.orig/config/config.mk              2010-10-28 19:05:18.000000000 -0400

+++ omniORB-4.1.7/config/config.mk    2014-04-28 16:42:12.000000000 -0400

@@ -58,7 +58,7 @@

#platform = x86_win32_vs_6

#platform = x86_win32_vs_7

#platform = x86_win32_vs_8

-#platform = x86_win32_vs_9

+platform = x86_win32_vs_9

#platform = x86_win32_vs_10

#platform = x86_win32_mingw

#platform = x86_win32_dmc

diff -rupN omniORB-4.1.7.orig/mk/platforms/x86_win32_vs_9.mk omniORB-4.1.7/mk/platforms/x86_win32_vs_9.mk

--- omniORB-4.1.7.orig/mk/platforms/x86_win32_vs_9.mk         2012-12-03 12:59:59.000000000 -0500

+++ omniORB-4.1.7/mk/platforms/x86_win32_vs_9.mk               2014-04-28 16:43:16.000000000 -0400

@@ -24,7 +24,7 @@ ABSTOP = $(shell cd $(TOP); pwd)

# In that case, uncomment the first line below.

 #PYTHON = $(ABSTOP)/$(BINDIR)/omnipython

-#PYTHON = /cygdrive/c/Python26/python

+PYTHON = /cygdrive/c/Python27/python



 # Use the following set of flags to build and use multithreaded DLLs

@@ -76,7 +76,7 @@ OMNINAMES_LOG_DEFAULT_LOCATION = C:\\tem

# the top level directory of the openssl library. The default is to disable

# the build.

#

-#OPEN_SSL_ROOT = /cygdrive/c/openssl

+OPEN_SSL_ROOT = REPLACE_WITH_MAVEN_LOCAL_REPO/NativeThirdParty/OpenSSL/OpenSSL-${OpenSSLVersion}-${osfamily.classifier}

#

 OPEN_SSL_CPPFLAGS = -I$(OPEN_SSL_ROOT)/include

--- omniORB-4.1.7.orig/src/lib/omniORB/orbcore/ssl/sslContext.cc          2013-04-10 13:09:25.000000000 -0400

+++ omniORB-4.1.7/src/lib/omniORB/orbcore/ssl/sslContext.cc                2015-03-04 15:18:03.349139200 -0500

@@ -152,6 +152,19 @@ sslContext::internal_initialise() {

     SSL_library_init();

     set_cipher();

     SSL_load_error_strings();

+

+    // BEB 12/12/2014 Turn "ON" FIPS mode for both client sockets and server sockets.

+    // "Currently FIPS_mode_set param values other than zero enable FIPS mode. In the future other values

+    // may specify additional actions beyond enabling FIPS mode, such as a value of 2 to

+    // designate an additional restriction to Suite B algorithms. To avoid further

+    // compatibility issues, a program is encouraged to call FIPS_mode_set() with

+    // a ONOFF value of 1 (rather than an arbitrary non-zero value)."

+    // http://wiki.openssl.org/index.php/FIPS_mode_set%28%29

+    if (0 == (FIPS_mode_set(1))) {

+      report_error();

+      OMNIORB_THROW(INITIALIZE,INITIALIZE_TransportError,

+                   CORBA::COMPLETED_NO);

+    }

   }

   pd_ctx = SSL_CTX_new(set_method());

@@ -372,7 +385,11 @@ sslContext::set_DH() {

/////////////////////////////////////////////////////////////////////////

void

sslContext::set_ephemeralRSA() {

+  // Default implementation does nothing. To support low-grade

+  // ephemeral RSA key exchange, use a subclass with code like the

+  // following:

+#if 0

   RSA *rsa;

   rsa = RSA_generate_key(512,RSA_F4,NULL,NULL);

@@ -381,6 +398,7 @@ sslContext::set_ephemeralRSA() {

     OMNIORB_THROW(INITIALIZE,INITIALIZE_TransportError,CORBA::COMPLETED_NO);

   }

   RSA_free(rsa);

+#endif

}







From: Sendil_Natarajan at amat.com [mailto:Sendil_Natarajan at amat.com]

Sent: Friday, March 27, 2015 8:53 AM

To: omniorb-list at omniorb-support.com

Subject: [omniORB] omni make error



Hi All,



I’m trying to build the omni service.



I get the below error while doing so. Please let me know how to resolve this. I’m building this using Cygwin in VS2012. The Cygwin has configured with corresponding information to use the correct Visual Studio.



$ make export

making export in src/tool...

make[1]: Entering directory '/cygdrive/c/omniORB-4.1.6/src/tool'

making export in src/tool/omniidl...

make[2]: Entering directory '/cygdrive/c/omniORB-4.1.6/src/tool/omniidl'

making export in src/tool/omniidl/cxx...

make[3]: Entering directory '/cygdrive/c/omniORB-4.1.6/src/tool/omniidl/cxx'

Traceback (most recent call last):

  File "<string>", line 1, in <module>

AttributeError: 'module' object has no attribute 'lower'

making export in src/tool/omniidl/cxx/cccp...

make[4]: Entering directory '/cygdrive/c/omniORB-4.1.6/src/tool/omniidl/cxx/ccc

'

+ rm -f omnicpp.exe

+ ../../../../../bin/x86_win32/linkwrapper -gnuwin32 -out:omnicpp.exe -nologo -

anifest -DEBUG -PDB:omnicpp.exe.pdb -libpath:../../../../../lib/x86_win32 cexp.

cccp.o config.o alloca.o index.o

link -out:omnicpp.exe -nologo -manifest -DEBUG -PDB:omnicpp.exe.pdb -libpath:..

..\..\..\..\lib\x86_win32 cexp.o cccp.o config.o alloca.o index.o

link: unknown option -- o

Try 'link --help' for more information.

+ mt.exe '/outputresource:omnicpp.exe;#1' /manifest omnicpp.exe.manifest

Microsoft (R) Manifest Tool version 6.3.9600.17298

Copyright (c) Microsoft Corporation 2012.

All rights reserved.



omnicpp.exe.manifest : general error c1010070: Failed to load and parse the man

fest. The system cannot find the file specified.

dir.mk:55: recipe for target 'omnicpp.exe' failed

make[4]: *** [omnicpp.exe] Error 31

make[4]: Leaving directory '/cygdrive/c/omniORB-4.1.6/src/tool/omniidl/cxx/cccp



dir.mk:21: recipe for target 'export' failed

make[3]: *** [export] Error 1

make[3]: Leaving directory '/cygdrive/c/omniORB-4.1.6/src/tool/omniidl/cxx'

dir.mk:15: recipe for target 'export' failed

make[2]: *** [export] Error 1

make[2]: Leaving directory '/cygdrive/c/omniORB-4.1.6/src/tool/omniidl'

dir.mk:22: recipe for target 'export' failed

make[1]: *** [export] Error 1

make[1]: Leaving directory '/cygdrive/c/omniORB-4.1.6/src/tool'

dir.mk:26: recipe for target 'export' failed

make: *** [export] Error 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20150327/bb6eb63f/attachment-0001.html>


More information about the omniORB-list mailing list