From 32f556637de8c0b9de626290f0859fc24f7ccf89 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 18 Jun 2012 14:52:03 -0500 Subject: [PATCH 1/9] libCom/osi: Fixed all epicsThreadSleep() implementations All are now robust against overflow, NAN or negative argument. Passing seconds=0 calls the OS scheduler, offering to yield. Passing seconds>0 delays at least the requested time, up to a limit which usually depends on the OS tick rate. --- src/libCom/osi/os/RTEMS/osdThread.c | 18 +++++++++--------- src/libCom/osi/os/WIN32/osdThread.c | 17 +++++++---------- src/libCom/osi/os/posix/osdThread.c | 12 +++++++++--- src/libCom/osi/os/vxWorks/osdThread.c | 11 +++++++---- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/libCom/osi/os/RTEMS/osdThread.c b/src/libCom/osi/os/RTEMS/osdThread.c index 7fa541bfd..f735671b1 100644 --- a/src/libCom/osi/os/RTEMS/osdThread.c +++ b/src/libCom/osi/os/RTEMS/osdThread.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -364,16 +365,15 @@ epicsThreadSleep (double seconds) { rtems_status_code sc; rtems_interval delay; - extern double rtemsTicksPerTwoSeconds_double; - - if (seconds <= 0.0) { - delay = 0; + extern double rtemsTicksPerSecond_double; + + if (seconds > 0.0) { + seconds *= rtemsTicksPerSecond_double; + seconds += 0.99999999; /* 8 9s here is optimal */ + delay = (seconds >= INT_MAX) ? INT_MAX : (int) seconds; } - else { - delay = seconds * rtemsTicksPerTwoSeconds_double; - delay = (delay + 1) / 2; - if (delay == 0) - delay++; + else { /* seconds <= 0 or NAN */ + delay = 0; } sc = rtems_task_wake_after (delay); if(sc != RTEMS_SUCCESSFUL) diff --git a/src/libCom/osi/os/WIN32/osdThread.c b/src/libCom/osi/os/WIN32/osdThread.c index 86f7b7df7..46c1009c8 100644 --- a/src/libCom/osi/os/WIN32/osdThread.c +++ b/src/libCom/osi/os/WIN32/osdThread.c @@ -779,18 +779,15 @@ epicsShareFunc void epicsShareAPI epicsThreadSleep ( double seconds ) static const unsigned mSecPerSec = 1000; DWORD milliSecDelay; - if ( seconds <= 0.0 ) { + if ( seconds > 0.0 ) { + seconds *= mSecPerSec; + seconds += 0.99999999; /* 8 9s here is optimal */ + milliSecDelay = ( seconds >= INFINITE ) ? + INFINITE - 1 : ( DWORD ) seconds; + } + else { /* seconds <= 0 or NAN */ milliSecDelay = 0u; } - else if ( seconds >= INFINITE / mSecPerSec ) { - milliSecDelay = INFINITE - 1; - } - else { - milliSecDelay = ( DWORD ) ( ( seconds * mSecPerSec ) + 0.5 ); - if ( milliSecDelay == 0 ) { - milliSecDelay = 1; - } - } Sleep ( milliSecDelay ); } diff --git a/src/libCom/osi/os/posix/osdThread.c b/src/libCom/osi/os/posix/osdThread.c index 3755d943a..30583e162 100644 --- a/src/libCom/osi/os/posix/osdThread.c +++ b/src/libCom/osi/os/posix/osdThread.c @@ -673,9 +673,15 @@ epicsShareFunc void epicsShareAPI epicsThreadSleep(double seconds) struct timespec remainingTime; double nanoseconds; - delayTime.tv_sec = (time_t)seconds; - nanoseconds = (seconds - (double)delayTime.tv_sec) *1e9; - delayTime.tv_nsec = (long)nanoseconds; + if (seconds > 0) { + delayTime.tv_sec = seconds; + nanoseconds = (seconds - delayTime.tv_sec) *1e9; + delayTime.tv_nsec = nanoseconds; + } + else { + delayTime.tv_sec = 0; + delayTime.tv_nsec = 0; + } while (nanosleep(&delayTime, &remainingTime) == -1 && errno == EINTR) delayTime = remainingTime; diff --git a/src/libCom/osi/os/vxWorks/osdThread.c b/src/libCom/osi/os/vxWorks/osdThread.c index 09d451fab..69034b794 100644 --- a/src/libCom/osi/os/vxWorks/osdThread.c +++ b/src/libCom/osi/os/vxWorks/osdThread.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -279,11 +280,13 @@ void epicsThreadSleep(double seconds) STATUS status; int ticks; - if(seconds<=0.0) { + if (seconds > 0.0) { + seconds *= sysClkRateGet(); + seconds += 0.99999999; /* 8 9s here is optimal */ + ticks = (seconds >= INT_MAX) ? INT_MAX : (int) seconds; + } + else { /* seconds <= 0 or NAN */ ticks = 0; - } else { - ticks = seconds*sysClkRateGet() + 0.5; - if(ticks<=0) ticks = 1; } status = taskDelay(ticks); if(status) errlogPrintf("epicsThreadSleep\n"); From 93bc78d2ed1307d5eb476e7de74fbd81d9c08c10 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 21 Jun 2012 12:09:04 -0500 Subject: [PATCH 2/9] configure: Don't override CROSS_COMPILER_TARGET_ARCHS on Cygwin All other host architectures have this setting commented out in their host-specific CONFIG_SITE..Common files, so the user doesn't get confused. --- configure/os/CONFIG_SITE.cygwin-x86.Common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure/os/CONFIG_SITE.cygwin-x86.Common b/configure/os/CONFIG_SITE.cygwin-x86.Common index c1fea1cc2..b99ac8e85 100644 --- a/configure/os/CONFIG_SITE.cygwin-x86.Common +++ b/configure/os/CONFIG_SITE.cygwin-x86.Common @@ -6,5 +6,5 @@ # Site override definitions for cygwin-x86 host builds #------------------------------------------------------- -CROSS_COMPILER_TARGET_ARCHS = +#CROSS_COMPILER_TARGET_ARCHS = From 1649ce6f791a7eb838bb519e6da028a78f5be699 Mon Sep 17 00:00:00 2001 From: Janet Anderson Date: Mon, 30 Jul 2012 17:10:57 -0500 Subject: [PATCH 3/9] Replaced makeDbDepends with mkmf --- configure/CONFIG_APP_INCLUDE | 4 ++-- configure/RULES.Db | 20 ++++++++-------- src/tools/makeDbDepends.pl | 24 ------------------- src/tools/mkmf.pl | 45 ++++++++++++++++++------------------ 4 files changed, 34 insertions(+), 59 deletions(-) delete mode 100644 src/tools/makeDbDepends.pl mode change 100644 => 100755 src/tools/mkmf.pl diff --git a/configure/CONFIG_APP_INCLUDE b/configure/CONFIG_APP_INCLUDE index 3951ed282..6b6786169 100644 --- a/configure/CONFIG_APP_INCLUDE +++ b/configure/CONFIG_APP_INCLUDE @@ -14,8 +14,8 @@ define RELEASE_FLAGS_template SHRLIB_SEARCH_DIRS += $$($(1)_LIB) RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include/os/$$(OS_CLASS))) RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include)) - RELEASE_DBDFLAGS += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/dbd)) - RELEASE_DBFLAGS += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/db)) + RELEASE_DBD_DIRS += $$(wildcard $$(strip $$($(1)))/dbd) + RELEASE_DB_DIRS += $$(wildcard $$(strip $$($(1)))/db) RELEASE_PERL_MODULE_DIRS += $$(wildcard $$($(1)_LIB)/perl) endef $(foreach top, $(RELEASE_TOPS), $(eval $(call RELEASE_FLAGS_template,$(top)) )) diff --git a/configure/RULES.Db b/configure/RULES.Db index 13efe3541..0ec2ca1c0 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -21,11 +21,11 @@ vpath %.acs $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR) ##################################################### dbdflags -# dbExpand -INSTALL_DBDFLAGS += -I $(INSTALL_DBD) -INSTALL_DBFLAGS += -I $(INSTALL_DB) -DBDFLAGS = $(USR_DBDFLAGS) -I. -I.. -I$(COMMON_DIR) $(INSTALL_DBDFLAGS) $(RELEASE_DBDFLAGS) -DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) -I. -I.. -I$(COMMON_DIR) $(INSTALL_DBFLAGS) $(RELEASE_DBFLAGS) +DBD_SEARCH_DIRS = . .. $(COMMON_DIR) $(SRC_DIRS) $(INSTALL_DBD) $(RELEASE_DBD_DIRS) +DB_SEARCH_DIRS = . .. $(COMMON_DIR) $(SRC_DIRS) $(INSTALL_DB) $(RELEASE_DB_DIRS) + +DBDFLAGS = $(USR_DBDFLAGS) $(addprefix -I,$(DBD_SEARCH_DIRS)) +DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) $(addprefix -I,$(DB_SEARCH_DIRS)) ##################################################### # To allow os specific dbd files AND have the -j option work properly, @@ -100,7 +100,7 @@ ACF_CPPFLAGS = $(ACF_CPPFLAGS_$(GNU)) ACF_INCLUDES = -I. $(TARGET_INCLUDES) $(USR_INCLUDES)\ $(SRC_INCLUDES) -I$(INSTALL_DB) -ACFDEPENDS_CMD = -$(MKMF) -m $(notdir $@)$(DEP) $(subst -I,,$(ACF_INCLUDES)) $@ $< +ACFDEPENDS_CMD = -$(MKMF) -m $(notdir $@)$(DEP) $(ACF_INCLUDES) $@ $< ACF_CMD = $(CPP) $(ACF_CPPFLAGS) $(ACF_INCLUDES) $< > $@ ##################################################### dependancies @@ -112,11 +112,9 @@ DBDDEPENDS_FILES += $(addsuffix $(DEP),$(HINC) \ $(patsubst $(COMMON_DIR)/%,%,$(COMMON_DBS)) \ $(patsubst $(COMMON_DIR)/%,%,$(COMMON_DBDS))) -DBDDEPENDS_FLAGS = $(subst -I,,$(filter-out -S%,$(DBDFLAGS))) +DBDDEPENDS_FLAGS = $(filter-out -S%,$(DBDFLAGS)) DBDDEPENDS_CMD = -$(MKMF) -m $(notdir $@)$(DEP) $(DBDDEPENDS_FLAGS) $@ $< -MAKEDBDEPENDS = $(PERL) $(TOOLS)/makeDbDepends.pl - ##################################################### ifndef T_A @@ -308,7 +306,7 @@ $(COMMON_DIR)/%.db$(RAW): $(COMMON_DIR)/%.edf $(COMMON_DIR)/%.db$(RAW): %.substitutions @$(RM) $(notdir $@)$(DEP) - @$(MAKEDBDEPENDS) $@ $< $(TEMPLATE_FILENAME) >> $(notdir $@)$(DEP) + @$(MKMF) -m$(notdir $@)$(DEP) $(DBFLAGS) $@ $< $(TEMPLATE_FILENAME) echo "$@ : $(TEMPLATE_FILENAME)" >> $(notdir $@)$(DEP) $(ECHO) "Inflating database from $< $(TEMPLATE_FILENAME)" @$(RM) $@ $*.tmp @@ -317,7 +315,7 @@ $(COMMON_DIR)/%.db$(RAW): %.substitutions $(COMMON_DIR)/%.db$(RAW): %.template @$(RM) $(notdir $@)$(DEP) - @$(MAKEDBDEPENDS) $@ $^ >> $(notdir $@)$(DEP) + @$(MKMF) -m$(notdir $@)$(DEP) $(DBFLAGS) $@ $< $(TEMPLATE_FILENAME) $(ECHO) "Inflating database from $<" @$(RM) $@ $*.tmp $(MSI) $(DBFLAGS) $< > $*.tmp diff --git a/src/tools/makeDbDepends.pl b/src/tools/makeDbDepends.pl deleted file mode 100644 index 1366091c7..000000000 --- a/src/tools/makeDbDepends.pl +++ /dev/null @@ -1,24 +0,0 @@ -eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*- - if $running_under_some_shell; # makeDbDepends.pl - -# Called from within RULES.Db in the Db directories. -# Searches .substitutions and .template files (from the command line) for -# file ["']xxx["'] { -# and -# include "xxx" -# entries to include in the DEPENDS file - -use strict; - -my $target = shift @ARGV; -my %depends; - -while (my $line = <>) { - $depends{$2}++ if $line =~ m/^ \s* file \s* (["']?) (\S*) \1 /x; - $depends{$1}++ if $line =~ m/^ \s* include \s* "(.*)" /x; -} - -if (%depends) { - my @depends = keys %depends; - print "$target: @depends\n"; -} diff --git a/src/tools/mkmf.pl b/src/tools/mkmf.pl old mode 100644 new mode 100755 index f29564ca1..76cc105f5 --- a/src/tools/mkmf.pl +++ b/src/tools/mkmf.pl @@ -25,39 +25,39 @@ # #----------------------------------------------------------------------- -use Getopt::Std; +use strict; + +use FindBin; +use lib "$FindBin::Bin/../../lib/perl"; + +use EPICS::Getopts; my $version = 'mkmf.pl,v 1.5 2002/03/25 21:33:24 jba Exp $ '; my $endline = $/; my %output; my @includes; -use vars qw( $opt_d $opt_m ); -getopts( 'dm:' ) || die "\aSyntax: $0 [-d] [-m dependsFile] includeDirs objFile srcFile\n"; +our ( $opt_d, $opt_m, @opt_I); +getopts( 'dm:I@' ) || die "\aSyntax: $0 [-d] [-m dependsFile] [-I incdir [-I incdir]...] objFile srcFile [srcfile]... \n"; my $debug = $opt_d; my $depFile = $opt_m; - -print "$0 $version\n" if $debug; - -# directory list -my @dirs; -my $i; -foreach $i (0 .. $#ARGV-2) { - push @dirs, $ARGV[$i]; -} - -my $objFile = $ARGV[$#ARGV-1]; -my $srcFile = $ARGV[$#ARGV]; +my @incdirs = @opt_I; +my $objFile = shift; +my @srcFiles=@ARGV; if( $debug ) { - print "DEBUG: dirs= @dirs\n"; - print "DEBUG: source= $srcFile\n"; - print "DEBUG: object= $objFile\n"; + print "$0 $version\n"; + print "DEBUG: incdirs= @incdirs\n"; + print "DEBUG: objFile= $objFile\n"; + print "DEBUG: srcFiles= @srcFiles\n"; } print "Generating dependencies for $objFile\n" if $debug; -scanFile($srcFile); -scanIncludesList(); + +foreach my $srcFile (@srcFiles) { + scanFile($srcFile); + scanIncludesList(); +} $depFile = 'depends' unless $depFile; @@ -118,7 +118,7 @@ sub scanIncludesList { } #----------------------------------------- -# find filename on #include line +# find filename on #include and file lines sub findNextIncName { my $line = shift; my $is_subst = shift; @@ -130,6 +130,7 @@ sub findNextIncName { if ($is_subst) { return 0 if not $line =~ /^\s*file\s*([^\s{]*)/; $incname = $1; + $incname = substr $incname, 1, length($incname)-2 if $incname =~ /^".+?"$/; } else { return 0 if not $line =~ /^#?\s*include\s*('.*?'|<.*?>|".*?")/; $incname = substr $1, 1, length($1)-2; @@ -139,7 +140,7 @@ sub findNextIncName { return $incname if -f $incname; return 0 if ( $incname =~ /^\// || $incname =~ /^\\/ ); - foreach $dir ( @dirs ) { + foreach $dir ( @incdirs ) { chomp($dir); $incfile = "$dir/$incname"; print "DEBUG: checking for $incname in $dir\n" if $debug; From 1864ac41fb2d58402c0db0bed6fa0074ffdfca5a Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 30 Jul 2012 17:50:30 -0500 Subject: [PATCH 4/9] Add support for native linux-arm builds. --- configure/os/CONFIG.Common.linux-arm | 2 +- configure/os/CONFIG.linux-arm.Common | 10 ++++++++++ configure/os/CONFIG.linux-arm.linux-arm | 10 ++++++++++ configure/os/CONFIG_SITE.linux-arm.linux-arm | 7 +++++++ configure/os/CONFIG_SITE.linux-x86.linux-arm | 8 +++++--- src/tools/mkmf.pl | 0 startup/EpicsHostArch | 19 +++++++++++-------- startup/EpicsHostArch.pl | 7 ++++--- 8 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 configure/os/CONFIG.linux-arm.Common create mode 100644 configure/os/CONFIG.linux-arm.linux-arm create mode 100644 configure/os/CONFIG_SITE.linux-arm.linux-arm mode change 100755 => 100644 src/tools/mkmf.pl diff --git a/configure/os/CONFIG.Common.linux-arm b/configure/os/CONFIG.Common.linux-arm index 15dad9e9e..7ccb1bbad 100644 --- a/configure/os/CONFIG.Common.linux-arm +++ b/configure/os/CONFIG.Common.linux-arm @@ -17,7 +17,7 @@ ifeq ($(BUILD_CLASS),CROSS) # prefix of compiler tools CMPLR_SUFFIX = - CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET)) + CMPLR_PREFIX = $(GNU_TARGET)- # Provide a link-time path for shared libraries SHRLIBDIR_RPATH_LDFLAGS_YES += $(SHRLIB_DEPLIB_DIRS:%=-Wl,-rpath-link,%) diff --git a/configure/os/CONFIG.linux-arm.Common b/configure/os/CONFIG.linux-arm.Common new file mode 100644 index 000000000..788f594d7 --- /dev/null +++ b/configure/os/CONFIG.linux-arm.Common @@ -0,0 +1,10 @@ +# CONFIG.linux-arm.Common +# +# $Revision-Id$ +# +# Definitions for linux-arm host builds +# Sites may override these definitions in CONFIG_SITE.linux-arm.Common +#------------------------------------------------------- + +#Include definitions common to unix hosts +include $(CONFIG)/os/CONFIG.UnixCommon.Common diff --git a/configure/os/CONFIG.linux-arm.linux-arm b/configure/os/CONFIG.linux-arm.linux-arm new file mode 100644 index 000000000..e52660f14 --- /dev/null +++ b/configure/os/CONFIG.linux-arm.linux-arm @@ -0,0 +1,10 @@ +# CONFIG.linux-arm.linux-arm +# +# $Revision-Id$ +# +# Definitions for native linux-arm builds +# Sites may override these definitions in CONFIG_SITE.linux-arm.linux-arm +#------------------------------------------------------- + +# Include common gnu compiler definitions +include $(CONFIG)/CONFIG.gnuCommon diff --git a/configure/os/CONFIG_SITE.linux-arm.linux-arm b/configure/os/CONFIG_SITE.linux-arm.linux-arm new file mode 100644 index 000000000..a8cc0ff9f --- /dev/null +++ b/configure/os/CONFIG_SITE.linux-arm.linux-arm @@ -0,0 +1,7 @@ +# CONFIG_SITE.linux-arm.linux-arm +# +# $Revision-Id$ +# +# Site specific definitions for native linux-arm builds +#------------------------------------------------------- + diff --git a/configure/os/CONFIG_SITE.linux-x86.linux-arm b/configure/os/CONFIG_SITE.linux-x86.linux-arm index 726d38578..f27a6a0cd 100644 --- a/configure/os/CONFIG_SITE.linux-x86.linux-arm +++ b/configure/os/CONFIG_SITE.linux-x86.linux-arm @@ -5,8 +5,10 @@ # Site specific definitions for linux-x86 host - linux-arm target builds #------------------------------------------------------- -# Diamond: +# Tools install path #GNU_DIR = /home/targetOS/linux-arm/host/x86-linux/gcc_3.3.3 -# anj@aps: -#GNU_DIR = /local/anj/cross-arm/gcc-3.4.5-glibc-2.3.6/arm-linux +GNU_DIR = /net/phoebus/vw/zynq-2011.09 + +# GNU crosscompiler target name +GNU_TARGET = arm-xilinx-linux-gnueabi diff --git a/src/tools/mkmf.pl b/src/tools/mkmf.pl old mode 100755 new mode 100644 diff --git a/startup/EpicsHostArch b/startup/EpicsHostArch index 6b102b9b9..8861ac56c 100755 --- a/startup/EpicsHostArch +++ b/startup/EpicsHostArch @@ -24,21 +24,24 @@ case $sysname in Linux ) os=linux cpu=`uname -m` - case $cpu in i386 | i486 | i586 | i686 ) - cpu=x86 - ;; + case $cpu in + i386 | i486 | i586 | i686 ) + cpu=x86 ;; + x86_64 ) + ;; # $cpu is correct + armv6l | armv7l ) + cpu=arm ;; esac - if [ ${cpu} = "x86_64" ]; then - cpu=x86_64 - fi echo ${os}-${cpu}${suffix} ;; Darwin ) os=darwin cpu=`uname -m` case $cpu in - "Power Macintosh") cpu=ppc ;; - i386 | x86_64 ) cpu=x86 ;; + "Power Macintosh") + cpu=ppc ;; + i386 | x86_64 ) + cpu=x86 ;; esac echo ${os}-${cpu}${suffix} ;; diff --git a/startup/EpicsHostArch.pl b/startup/EpicsHostArch.pl index 7fb5747c8..1c4a96dcb 100755 --- a/startup/EpicsHostArch.pl +++ b/startup/EpicsHostArch.pl @@ -24,10 +24,11 @@ print "$EpicsHostArch$suffix"; sub GetEpicsHostArch { # no args $arch=$Config{'archname'}; - if ($arch =~ /sun4-solaris/) { return "solaris-sparc"; + if ($arch =~ /sun4-solaris/) { return "solaris-sparc"; } elsif ($arch =~ m/i86pc-solaris/) { return "solaris-x86"; - } elsif ($arch =~ m/i[3-6]86-linux/) { return "linux-x86"; - } elsif ($arch =~ m/x86_64-linux/) { return "linux-x86_64"; + } elsif ($arch =~ m/i[3-6]86-linux/){ return "linux-x86"; + } elsif ($arch =~ m/x86_64-linux/) { return "linux-x86_64"; + } elsif ($arch =~ m/arm-linux/) { return "linux-arm"; } elsif ($arch =~ m/MSWin32-x86/) { return "win32-x86"; } elsif ($arch =~ m/cygwin/) { return "cygwin-x86"; } elsif ($arch =~ m/darwin/) { From dabd0a969b8be31a0fb62b32b1ffdf0fe59bb142 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 31 Jul 2012 10:03:57 -0500 Subject: [PATCH 5/9] Release notes update. --- documentation/RELEASE_NOTES.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 761c6030a..461cc0f7d 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,21 @@ +

Build problem with db dependencies

+ +

The dependency output for .db and .acf files created by makeDbDepends.pl did +not show the directories of the depended files. The makeDbDepends.pl script has +been replaced by mkmf.pl for this purpose after modifying it to accept multiple +-I include directory options and more than on source file on the command line. +The makeDbDepends.pl script has been removed from Base.

+ +

Native linux-arm builds added

+ +

The configuration files needed for a linux-arm system to build Base for +itself have now been added. Both the Shell and Perl versions of the startup +EpicsHostArch scripts now recognize both arm6l and arm7l CPUs and return the +generic linux-arm host architecture name for them.

+

Launchpad Bugs Resolved

The following are links to bugs in the Launchpad bug tracker that have been From 4133b666a0e4125c94478399c594d23a0796104e Mon Sep 17 00:00:00 2001 From: Janet Anderson Date: Tue, 31 Jul 2012 10:44:33 -0500 Subject: [PATCH 6/9] Added die if no target file argument --- src/tools/mkmf.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/mkmf.pl b/src/tools/mkmf.pl index 76cc105f5..fa3c5055c 100644 --- a/src/tools/mkmf.pl +++ b/src/tools/mkmf.pl @@ -42,7 +42,7 @@ getopts( 'dm:I@' ) || die "\aSyntax: $0 [-d] [-m dependsFile] [-I incdir [-I inc my $debug = $opt_d; my $depFile = $opt_m; my @incdirs = @opt_I; -my $objFile = shift; +my $objFile = shift or die "No target file argument"; my @srcFiles=@ARGV; if( $debug ) { From b1ac0c18c40934a69035e9ac381040fccbd6e2fa Mon Sep 17 00:00:00 2001 From: Janet Anderson Date: Tue, 31 Jul 2012 10:48:01 -0500 Subject: [PATCH 7/9] Fixed typo --- documentation/RELEASE_NOTES.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 461cc0f7d..3c5ba6836 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -18,7 +18,7 @@

The dependency output for .db and .acf files created by makeDbDepends.pl did not show the directories of the depended files. The makeDbDepends.pl script has been replaced by mkmf.pl for this purpose after modifying it to accept multiple --I include directory options and more than on source file on the command line. +-I include directory options and more than one source file on the command line. The makeDbDepends.pl script has been removed from Base.

Native linux-arm builds added

From 20c9fa2e8a14e3e92f761374a6a0f58086931bcd Mon Sep 17 00:00:00 2001 From: Janet Anderson Date: Tue, 31 Jul 2012 10:50:51 -0500 Subject: [PATCH 8/9] Added template file as dependency for .db.d file --- configure/RULES.Db | 1 + 1 file changed, 1 insertion(+) diff --git a/configure/RULES.Db b/configure/RULES.Db index 0ec2ca1c0..ba779589c 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -308,6 +308,7 @@ $(COMMON_DIR)/%.db$(RAW): %.substitutions @$(RM) $(notdir $@)$(DEP) @$(MKMF) -m$(notdir $@)$(DEP) $(DBFLAGS) $@ $< $(TEMPLATE_FILENAME) echo "$@ : $(TEMPLATE_FILENAME)" >> $(notdir $@)$(DEP) + echo "$(notdir $@)$(DEP): $(TEMPLATE_FILENAME)" >> $(notdir $@)$(DEP) $(ECHO) "Inflating database from $< $(TEMPLATE_FILENAME)" @$(RM) $@ $*.tmp $(MSI) $(DBFLAGS) -S$< $(TEMPLATE_FILENAME) > $*.tmp From bdbada28a82ef88a7005653e979ae7bc2eb603be Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 31 Jul 2012 13:47:23 -0500 Subject: [PATCH 9/9] makeBaseApp: Remove bad characters from user names Also warns about some bad characters in record names, but only the ones that are known to cause known bad behaviour. --- src/dbStatic/dbLexRoutines.c | 63 +++++++++++++++++++--------------- src/makeBaseApp/makeBaseApp.pl | 13 ++++--- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/src/dbStatic/dbLexRoutines.c b/src/dbStatic/dbLexRoutines.c index a3cf78308..3620cc7b9 100644 --- a/src/dbStatic/dbLexRoutines.c +++ b/src/dbStatic/dbLexRoutines.c @@ -907,43 +907,52 @@ static void dbBreakBody(void) pgphentry->userPvt = pnewbrkTable; } -static void dbRecordHead(char *recordType,char *name, int visible) +static void dbRecordHead(char *recordType, char *name, int visible) { - DBENTRY *pdbentry; - long status; + char *badch; + DBENTRY *pdbentry; + long status; + badch = strpbrk(name, " \"'.$"); + if (badch) { + epicsPrintf("Bad character '%c' in record name \"%s\"\n", + *badch, name); + } pdbentry = dbAllocEntry(pdbbase); - if(ellCount(&tempList)) - yyerrorAbort("dbRecordHead: tempList not empty"); + if (ellCount(&tempList)) + yyerrorAbort("dbRecordHead: tempList not empty"); allocTemp(pdbentry); - status = dbFindRecordType(pdbentry,recordType); - if(status) { - epicsPrintf("Record \"%s\" is of unknown type \"%s\" - ", + status = dbFindRecordType(pdbentry, recordType); + if (status) { + epicsPrintf("Record \"%s\" is of unknown type \"%s\" - ", name, recordType); - yyerrorAbort(NULL); - return; + yyerrorAbort(NULL); + return; } /*Duplicate records ok if the same type */ status = dbCreateRecord(pdbentry,name); - if(status==S_dbLib_recExists) { - if(strcmp(recordType,dbGetRecordTypeName(pdbentry))!=0) { - epicsPrintf("Record %s already defined with different type %s\n", - name, dbGetRecordTypeName(pdbentry)); + if (status==S_dbLib_recExists) { + if (strcmp(recordType, dbGetRecordTypeName(pdbentry))!=0) { + epicsPrintf("Record \"%s\" already defined with different type " + "\"%s\"\n", name, dbGetRecordTypeName(pdbentry)); yyerror(NULL); - duplicate = TRUE; - return; - } else if (dbRecordsOnceOnly) { - epicsPrintf("Record \"%s\" already defined (dbRecordsOnceOnly is set)\n", - name); - yyerror(NULL); - duplicate = TRUE; - } - } else if(status) { - epicsPrintf("Can't create record \"%s\" of type \"%s\"\n", - name, recordType); - yyerrorAbort(NULL); + duplicate = TRUE; + return; + } + else if (dbRecordsOnceOnly) { + epicsPrintf("Record \"%s\" already defined (dbRecordsOnceOnly is " + "set)\n", name); + yyerror(NULL); + duplicate = TRUE; + } } - if(visible) dbVisibleRecord(pdbentry); + else if (status) { + epicsPrintf("Can't create record \"%s\" of type \"%s\"\n", + name, recordType); + yyerrorAbort(NULL); + } + if (visible) + dbVisibleRecord(pdbentry); } static void dbRecordField(char *name,char *value) diff --git a/src/makeBaseApp/makeBaseApp.pl b/src/makeBaseApp/makeBaseApp.pl index f60ec3e5d..7a816a0eb 100755 --- a/src/makeBaseApp/makeBaseApp.pl +++ b/src/makeBaseApp/makeBaseApp.pl @@ -21,10 +21,10 @@ $app_top = cwd(); $bad_ident_chars = '[^0-9A-Za-z_]'; -&GetUser; # Ensure we know who's in charge &readReleaseFiles("configure/RELEASE", \%release, \@apps); &expandRelease(\%release); &get_commandline_opts; # Check command-line options +&GetUser; # Ensure we know who's in charge # # Declare two default callback routines for file copy plus two @@ -164,7 +164,7 @@ exit 0; # END OF SCRIPT # Get commandline options and check for validity # sub get_commandline_opts { #no args - getopts("a:b:dhilp:T:t:") or Cleanup(1); + getopts("a:b:dhilp:T:t:u:") or Cleanup(1); # Options help Cleanup(0) if $opt_h; @@ -395,7 +395,7 @@ EOF -d Enable debug messages -i Specifies that ioc boot directories will be generated -l List valid application types for this installation - If this is specified the other options are not used + If this is specified the other options are not used -p app Set the application name for use with -i If not specified, you will be prompted -T top Set the template top directory (where the application templates are) @@ -405,6 +405,7 @@ EOF -t type Set the application type (-l for a list of valid types) If not specified, type is taken from environment If not found in environment, \"default\" is used + -u user Set username; overrides OS defaults Environment: EPICS_MBA_DEF_APP_TYPE Application type you want to use as default @@ -419,10 +420,7 @@ EOF } sub GetUser { - # add to this list if new possibilities arise, - # currently it's UNIX and WIN32: - $user = $ENV{USER} || $ENV{USERNAME} || Win32::LoginName(); - $user =~ s/\s+//g; # Bl**dy Windows stupidity... + $user = $opt_u || $ENV{USER} || $ENV{USERNAME} || Win32::LoginName(); unless ($user) { print "Strange, I cannot figure out your user name!\n"; @@ -430,5 +428,6 @@ sub GetUser { $user = ; chomp $user; } + $user =~ tr/-a-zA-Z0-9_:;[]<>//cd; # Sanitize; these are the legal chars die "No user name" unless $user; }