[openssl-commits] [openssl] master update
Richard Levitte
levitte at openssl.org
Tue Mar 14 21:27:21 UTC 2017
The branch master has been updated
via a74db02a2e182a16c76a12da1ac8ae8a215746b0 (commit)
via 2de2df7fe8986e6e25afa72a5fe6a92272eaa4ff (commit)
from 22df22e7c3de7e577bbf4db04e21def38b303c8e (commit)
- Log -----------------------------------------------------------------
commit a74db02a2e182a16c76a12da1ac8ae8a215746b0
Author: Richard Levitte <levitte at openssl.org>
Date: Tue Mar 14 22:09:57 2017 +0100
VMS: throw away [.util]shareable_image_wrap.c.in and add replacement scripts
[.util]shareable_image_wrap.c.in was never useful because lib$spawn()
insisted on combining stdout and stderr into one.
Instead, we introduce two scripts that create and destroy a temporary
environment where the local shareable images become available,
[.util]local_shlib.com and [.util]unlocal_shlib.com. They also define
DBG$IMAGE_DSF_PATH, which is require so the debugger can find the Debug
Symbol Files.
Reviewed-by: Rich Salz <rsalz at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2947)
commit 2de2df7fe8986e6e25afa72a5fe6a92272eaa4ff
Author: Richard Levitte <levitte at openssl.org>
Date: Tue Mar 14 22:00:13 2017 +0100
VMS: Change debug linking method to generate a separate Debug Symbol File
That makes it possible to run images without automagically ending up
in a debug session, while still being able to debug when required.
All .DSF files must reside in the same directory to be useful.
Reviewed-by: Rich Salz <rsalz at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2947)
-----------------------------------------------------------------------
Summary of changes:
Configurations/10-main.conf | 4 +-
Configurations/descrip.mms.tmpl | 12 ++---
util/build.info | 6 +--
util/local_shlib.com.in | 31 +++++++++++
util/shareable_image_wrap.c.in | 113 ----------------------------------------
util/unlocal_shlib.com.in | 27 ++++++++++
6 files changed, 69 insertions(+), 124 deletions(-)
create mode 100644 util/local_shlib.com.in
delete mode 100644 util/shareable_image_wrap.c.in
create mode 100644 util/unlocal_shlib.com.in
diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
index 91dd65f..c3d2e94 100644
--- a/Configurations/10-main.conf
+++ b/Configurations/10-main.conf
@@ -1785,8 +1785,8 @@ sub vms_info {
debug => "/NOOPTIMIZE/DEBUG",
release => "/OPTIMIZE/NODEBUG"),
defines => add("OPENSSL_USE_NODELETE"),
- lflags => picker(default => "/MAP",
- debug => "/DEBUG/TRACEBACK",
+ lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
+ debug => "/DSF='F\$PARSE(\"\$(BLDDIR).DSF\",\"\$\@\")'/TRACEBACK",
release => "/NODEBUG/NOTRACEBACK"),
lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
# no_inst_bin_cflags is used instead of bin_cflags by descrip.mms.tmpl
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index cde5144..a57188d 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -314,11 +314,11 @@ uninstall : uninstall_docs uninstall_sw
# use $(LIBS), $(PROGRAMS), $(GENERATED) and $(ENGINES)directly.
libclean :
{- join("\n\t", map { "- DELETE $_.OLB;*" } @{$unified_info{libraries}}) || "@ !" -}
- {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*,$_.OPT;*" } @shlibs) || "@ !" -}
+ {- join("\n\t", map { "- DELETE $_.EXE;*,$_.DSF;*,$_.MAP;*,$_.OPT;*" } @shlibs) || "@ !" -}
clean : libclean
- {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
- {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{engines}}) || "@ !" -}
+ {- join("\n\t", map { "- DELETE $_.EXE;*,$_.DSF;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
+ {- join("\n\t", map { "- DELETE $_.EXE;*,$_.DSF;*,$_.OPT;*" } @{$unified_info{engines}}) || "@ !" -}
{- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{scripts}}) || "@ !" -}
{- join("\n\t", map { "- DELETE $_;*" } @generated) || "@ !" -}
- DELETE [...]*.MAP;*
@@ -672,7 +672,7 @@ $shlib.EXE : $lib.OLB $deps $ordinalsfile
WRITE OPT_FILE "$lib.OLB/LIBRARY"
$write_opt
CLOSE OPT_FILE
- LINK /MAP=$shlib.MAP /FULL/SHARE=$shlib.EXE $shlib.OPT/OPT \$(EX_LIBS)
+ LINK \$(LDFLAGS)/SHARE=\$\@ $shlib.OPT/OPT \$(EX_LIBS)
DELETE $shlib.SYMVEC;*
PURGE $shlib.EXE,$shlib.OPT,$shlib.MAP
EOF
@@ -711,7 +711,7 @@ $lib.EXE : $deps
$write_opt1
$write_opt2
CLOSE OPT_FILE
- LINK /MAP=$lib.MAP /FULL/SHARE=$lib.EXE $lib.OPT/OPT \$(EX_LIBS)
+ LINK \$(LDFLAGS)/SHARE=\$\@ $lib.OPT/OPT \$(EX_LIBS)
- PURGE $lib.EXE,$lib.OPT,$lib.MAP
EOF
}
@@ -775,7 +775,7 @@ $bin.EXE : $deps
$write_opt2
CLOSE OPT_FILE
- pipe SPAWN/WAIT/NOLOG/OUT=$bin.LINKLOG -
- LINK/EXEC=$bin.EXE \$(LDFLAGS) $bin.OPT/OPT \$(EX_LIBS) ; -
+ LINK \$(LDFLAGS)/EXEC=\$\@ $bin.OPT/OPT \$(EX_LIBS) ; -
link_status = \$status ; link_severity = link_status .AND. 7
@ search_severity = 1
-@ IF link_severity .EQ. 0 THEN -
diff --git a/util/build.info b/util/build.info
index e044d94..609be51 100644
--- a/util/build.info
+++ b/util/build.info
@@ -1,7 +1,7 @@
IF[{- $target{build_scheme}->[1] eq "VMS" -}]
- PROGRAMS_NO_INST=shlib_wrap
- SOURCE[shlib_wrap]=shareable_image_wrap.c
- GENERATE[shareable_image_wrap.c]=shareable_image_wrap.c.in
+ SCRIPTS_NO_INST=local_shlib.com unlocal_shlib.com
+ SOURCE[local_shlib.com]=local_shlib.com.in
+ SOURCE[unlocal_shlib.com]=unlocal_shlib.com.in
ELSIF[{- $target{build_scheme}->[1] eq "unix" -}]
SCRIPTS_NO_INST=shlib_wrap.sh
SOURCE[shlib_wrap.sh]=shlib_wrap.sh.in
diff --git a/util/local_shlib.com.in b/util/local_shlib.com.in
new file mode 100644
index 0000000..daceffc
--- /dev/null
+++ b/util/local_shlib.com.in
@@ -0,0 +1,31 @@
+${-
+ use File::Spec::Functions qw(rel2abs);
+
+ my $bldtop = rel2abs($config{builddir});
+ our %names = ( ( map { $_ => $bldtop.$_.".EXE" }
+ map { $unified_info{sharednames}->{$_} || () }
+ @{$unified_info{libraries}} ),
+ 'DBG$IMAGE_DSF_PATH' => $bldtop );
+ "" -}
+$ ! Create a local environment with the shared library logical names
+$ ! properly set. Undo this with unlocal_shlib.com
+$
+$ OPENSSL_NAMES := OPENSSL_NAMES_'F$GETJPI("","PID")'
+$ CREATE/NAME_TABLE/PARENT_TABLE=LNM$PROCESS_DIRECTORY 'OPENSSL_NAMES'
+$ DEFINE/TABLE='OPENSSL_NAMES' OSSL_FLAG YES
+$
+$ NAMES := {- join(",", keys %names); -}
+{-
+ join("\n", map { "\$ __$_ = \"".$names{$_}."\"" } keys %names);
+-}
+$ I = 0
+$ LOOP:
+$ E = F$ELEMENT(I,",",NAMES)
+$ I = I + 1
+$ IF E .EQS. "," THEN GOTO ENDLOOP
+$ EV = __'E'
+$ OLDV = F$TRNLNM(E,"LNM$PROCESS")
+$ IF OLDV .NES. "" THEN DEFINE/TABLE='OPENSSL_NAMES' 'E' 'OLDV'
+$ DEFINE 'E' 'EV'
+$ GOTO LOOP
+$ ENDLOOP:
diff --git a/util/shareable_image_wrap.c.in b/util/shareable_image_wrap.c.in
deleted file mode 100644
index 567e408..0000000
--- a/util/shareable_image_wrap.c.in
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the OpenSSL license (the "License"). You may not use
- * this file except in compliance with the License. You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * This program allows for easy execution of programs in the OpenSSL build
- * directory, in a manner that's similar to how util/shlib_wrap.sh. Simply
- * take the command you want to execute and prefix that with
- * 'mcr [.util]shlib_wrap', for example:
- *
- * $ mcr [.util]shlib_wrap mcr [.apps]openssl s_client -connect www.openssl.org:443
- */
-
-#ifndef __VMS
-# error "VMS ONLY!"
-#endif
-
-#include <stdio.h>
-#include <descrip.h>
-#include <ssdef.h>
-#include <lib$routines.h>
-{-
- use File::Spec::Functions qw(rel2abs);
- our $sv = sprintf "%02d%02d", $config{shlib_major}, $config{shlib_minor};
- our $pz = $config{pointer_size};
- our $bldd = rel2abs($config{builddir});
- ""
--}
-/* The logical name table we check and affect */
-$DESCRIPTOR(lnm_process_table, "LNM$PROCESS_TABLE");
-
-/* The first logical name we deal with, the buffer for its old value,
- * and its temporary new value
- */
-const $DESCRIPTOR(lnm1, "OSSL$LIBCRYPTO{- $sv -}_SHR{- $pz -}");
-char lnm1oldbuf[256]; short lnm1oldlen = 0;
-$DESCRIPTOR(lnm1old, lnm1oldbuf);
-const $DESCRIPTOR(lnm1new, "{- $bldd -}OSSL$LIBCRYPTO{- $sv -}_SHR{- $pz -}.EXE");
-
-/* The second logical name we deal with, the buffer for its old value,
- * and its temporary new value
- */
-const $DESCRIPTOR(lnm2, "OSSL$LIBSSL{- $sv -}_SHR{- $pz -}");
-char lnm2oldbuf[256]; short lnm2oldlen = 0;
-$DESCRIPTOR(lnm2old, lnm2oldbuf);
-const $DESCRIPTOR(lnm2new, "{- $bldd -}OSSL$LIBSSL{- $sv -}_SHR{- $pz -}.EXE");
-
-/* The foreign command we want to run with the logical names above set
- * to their temporary values
- */
-char foreign_cmd_buf[4096]; short foreign_cmd_len = 0;
-$DESCRIPTOR(foreign_cmd, foreign_cmd_buf);
-
-int main()
-{
- int status = 0;
- int lnm1status = 0, lnm2status = 0;
-
- /* Fetch the command line. lib$get_foreign() is nice enough to
- * strip away the program name, thus only returning the arguments,
- * which is exactly what we need.
- */
- lib$get_foreign(&foreign_cmd, 0, &foreign_cmd_len);
- foreign_cmd.dsc$w_length = foreign_cmd_len;
-
-#ifdef DEBUG
- foreign_cmd_buf[foreign_cmd_len] = '\0';
- printf("[%d] %s\n\n", foreign_cmd_len, foreign_cmd_buf);
-#endif
-
- /* Fetch the first logical name value and save the status */
- lnm1status = lib$get_logical(&lnm1, &lnm1old, &lnm1oldlen,
- &lnm_process_table);
- if (lnm1status == SS$_NORMAL)
- lnm1old.dsc$w_length = lnm1oldlen;
- else if (lnm1status != SS$_NOLOGNAM)
- return lnm1status;
-
- /* Fetch the first logical name value and save the status */
- lnm2status = lib$get_logical(&lnm2, &lnm2old, &lnm2oldlen,
- &lnm_process_table);
- if (lnm2status == SS$_NORMAL)
- lnm2old.dsc$w_length = lnm2oldlen;
- else if (lnm2status != SS$_NOLOGNAM)
- return lnm2status;
-
- /* Set the temporary new values for both logical names */
- lib$set_logical(&lnm1, &lnm1new, &lnm_process_table);
- lib$set_logical(&lnm2, &lnm2new, &lnm_process_table);
-
- /* Execute the arguments as a command. The better be a command! */
- status = lib$spawn(&foreign_cmd);
-
- /* If the logical names we set had old values, restore them.
- * Otherwise, simply delete their current values.
- */
- if (lnm1status == SS$_NORMAL)
- lib$set_logical(&lnm1, &lnm1old, &lnm_process_table);
- else
- lib$delete_logical(&lnm1, &lnm_process_table);
- if (lnm2status == SS$_NORMAL)
- lib$set_logical(&lnm2, &lnm2old, &lnm_process_table);
- else
- lib$delete_logical(&lnm2, &lnm_process_table);
-
- /* Return the status from the execution of the foreign command */
- return status;
-}
diff --git a/util/unlocal_shlib.com.in b/util/unlocal_shlib.com.in
new file mode 100644
index 0000000..67120c6
--- /dev/null
+++ b/util/unlocal_shlib.com.in
@@ -0,0 +1,27 @@
+${-
+ use File::Spec::Functions qw(rel2abs);
+
+ my $bldtop = rel2abs($config{builddir});
+ our %names = ( ( map { $_ => $bldtop.$_.".EXE" }
+ map { $unified_info{sharednames}->{$_} || () }
+ @{$unified_info{libraries}} ),
+ 'DBG$IMAGE_DSF_PATH' => $bldtop );
+ "" -}
+$ ! Remove the local environment created by local_shlib.com
+$
+$ OPENSSL_NAMES := OPENSSL_NAMES_'F$GETJPI("","PID")'
+$ IF F$TRNLNM("OSSL_FLAG",OPENSSL_NAMES) .EQS. "" THEN EXIT 0
+$
+$ NAMES := {- join(",", keys %names); -}
+$ I = 0
+$ LOOP:
+$ E = F$ELEMENT(I,",",NAMES)
+$ I = I + 1
+$ IF E .EQS. "," THEN GOTO ENDLOOP
+$ OLDV = F$TRNLNM(E,OPENSSL_NAMES)
+$ DEASSIGN 'E'
+$ IF OLDV .NES. "" THEN DEFINE 'E' 'OLDV'
+$ GOTO LOOP
+$ ENDLOOP:
+$
+$ DEASSIGN 'OPENSSL_NAMES' /TABLE=LNM$PROCESS_DIRECTORY
More information about the openssl-commits
mailing list