Skip to content

Commit baf89c4

Browse files
authored
Merge pull request #2296 from LinuxCNC/halcompile-permissions
Halcompile permissions
2 parents 21966e9 + 54ad24d commit baf89c4

4 files changed

Lines changed: 37 additions & 0 deletions

File tree

src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ modules: $(patsubst %.o,../rtlib/%.so,$(obj-m))
10631063
$(Q)objcopy -j .rtapi_export -O binary objects/$*.tmp objects/$*.sym
10641064
$(Q)(echo '{ global : '; tr -s '\0' < objects/$*.sym | xargs -r0 printf '%s;\n' | grep .; echo 'local : * ; };') > objects/$*.ver
10651065
$(Q)$(CC) -shared -Bsymbolic $(LDFLAGS) -Wl,--version-script,objects/$*.ver -o $@ $^ -lm
1066+
$(Q)chmod -x $@
10661067

10671068
RTFLAGS += -fno-strict-aliasing -fwrapv
10681069

src/Makefile.modinc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ $(foreach mod,$(patsubst %.o,%,$(obj-m)),\
121121
$(Q)objcopy -j .rtapi_export -O binary $*.tmp $*.sym
122122
$(Q)(echo '{ global : '; tr -s '\0' < $*.sym | xargs -r0 printf '%s;\n' | grep .; echo 'local : * ; };') > $*.ver
123123
$(Q)$(CC) -shared -Bsymbolic $(LDFLAGS) -Wl,--version-script,$*.ver -o $@ $^ -lm
124+
$(Q)chmod -x $@
124125
endif
125126

126127
ifeq ($(BUILDSYS),normal)

tests/halcompile/personalities_mod/test.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
#!/bin/sh
2+
set -e
3+
24
DIR=../../../src/hal/components ;# use in-tree components
35
halcompile --personalities=2 --install $DIR/lincurve.comp
46
halcompile --personalities=2 --install $DIR/logic.comp
57
halcompile --personalities=2 --install $DIR/bitslice.comp
68

9+
# This tells us the expected filename extension ${MODULE_EXT} of realtime
10+
# modules.
11+
source "${EMC2_HOME}/scripts/rtapi.conf"
12+
13+
for INSTALLED_FILE in "${EMC2_HOME}"/rtlib/{lincurve,logic,bitslice}"${MODULE_EXT}"; do
14+
if [[ ! -f "${INSTALLED_FILE}" ]]; then
15+
echo "'halcompile --install' did not install '${INSTALLED_FILE}'"
16+
exit 1
17+
fi
18+
19+
MODE=$(stat --printf '%#03a\n' "${INSTALLED_FILE}")
20+
if [[ $((MODE & 0111)) != '0' ]]; then
21+
echo "installed file '${INSTALLED_FILE}' has incorrect permissions"
22+
echo "expected no execute bits, got ${MODE}"
23+
exit 1
24+
fi
25+
done
26+
727
for HAL in *.hal; do
828
echo "testing $HAL"
929
BASE=$(basename $HAL .hal)

tests/halcompile/userspace-count-names/test.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
#!/bin/sh
2+
set -e
3+
24
halcompile --install userspace_count_names.comp
35

6+
INSTALLED_FILE="${EMC2_HOME}/bin/userspace_count_names"
7+
if [[ ! -f "${INSTALLED_FILE}" ]]; then
8+
echo "'halcompile --install' did not install '${INSTALLED_FILE}'"
9+
exit 1
10+
fi
11+
12+
MODE=$(stat --printf '%#03a\n' "${INSTALLED_FILE}")
13+
if [[ $((MODE & 0111)) == '0' ]]; then
14+
echo "installed file '${INSTALLED_FILE}' has incorrect permissions"
15+
echo "expected *some* execute bit, got ${MODE}"
16+
exit 1
17+
fi
18+
419
for HAL in *.hal; do
520
echo "testing $HAL"
621
BASE=$(basename $HAL .hal)

0 commit comments

Comments
 (0)