Skip to content

Commit

Permalink
Aarch 64 comp changes (#4021)
Browse files Browse the repository at this point in the history
* fgetc casts result to int

* aarch64 does not have SYS_open

* rmonitor not when crosscompiling

Piggybacker does not work in such case.
  • Loading branch information
btovar authored Jan 13, 2025
1 parent 123c9cb commit d2a9117
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
8 changes: 4 additions & 4 deletions batch_job/src/batch_queue_k8s.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ static int batch_queue_k8s_gen_running_pod_lst(struct list **running_pod_lst,
pod_state = strtok(NULL, " \t");

int i = 0;
while (pod_state[i] != '\n' && pod_state[i] != EOF)
while (pod_state[i] != '\n' && pod_state[i] != '\0')
i++;
if (pod_state[i] == '\n' || pod_state[i] == EOF)
if (pod_state[i] == '\n')
pod_state[i] = '\0';

if (strcmp(pod_state, "Running") == 0) {
Expand Down Expand Up @@ -607,9 +607,9 @@ static batch_queue_id_t batch_queue_k8s_wait(struct batch_queue *q,

// trim the tailing new line
int i = 0;
while (log_tail_content[i] != '\n' && log_tail_content[i] != EOF)
while (log_tail_content[i] != '\n' && log_tail_content[i] != '\0')
i++;
if (log_tail_content[i] == '\n' || log_tail_content[i] == EOF)
if (log_tail_content[i] == '\n' || log_tail_content[i] == '\0')
log_tail_content[i] = '\0';

free(get_log_cmd);
Expand Down
12 changes: 11 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ case "$BUILD_CPU" in
;;
esac

if [ "$BUILD_CPU" = X86_64 -a "$BUILD_SYS" = LINUX -a "$CONDA_BUILD_CROSS_COMPILATION" != 1 ]
then
BUILD_LINUX_NATIVE_X86_64=yes
else
BUILD_LINUX_NATIVE_X86_64=no
fi


include_package_chirp="chirp"
include_package_deltadb="deltadb"
include_package_doc="doc"
Expand Down Expand Up @@ -1241,7 +1249,7 @@ fi

if [ "$include_package_resource_monitor" = resource_monitor ]
then
if [ -d resource_monitor -a $BUILD_SYS = LINUX ]
if [ -d resource_monitor -a "$BUILD_LINUX_NATIVE_X86_64" = yes ]
then
echo "resource_monitor IS supported on ${BUILD_SYS}"
else
Expand Down Expand Up @@ -1429,6 +1437,8 @@ CCTOOLS_INSTALL_DIR=${install_path}
CCTOOLS_OPSYS=${BUILD_SYS}
CCTOOLS_LINUX_NATIVE_X86_64=${BUILD_LINUX_NATIVE_X86_64}
CCTOOLS_PACKAGES=${packages}
CCTOOLS_CC=${CCTOOLS_CC}
Expand Down
2 changes: 1 addition & 1 deletion dttools/src/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ static unsigned char pcx_rle_repeat = 0;
static unsigned char pcx_rle_value = 0;
static unsigned char pcx_rle_read(FILE *file)
{
unsigned char c;
int c;
retry:
if (pcx_rle_repeat > 0) {
pcx_rle_repeat--;
Expand Down
2 changes: 1 addition & 1 deletion dttools/src/envtools.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int env_replace(const char *infile, const char *outfile)
int var_index = 0;
int valid_var = 0;

char c = fgetc(INPUT);
int c = fgetc(INPUT);
while (c != EOF) {
if (c == '$') {
valid_var = 1;
Expand Down
6 changes: 3 additions & 3 deletions resource_monitor/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ LOCAL_LINKAGE = ../../dttools/src/libdttools.a

PROGRAMS = resource_monitor piggybacker rmonitor_poll_example rmonitor_snapshot

ifeq ($(CCTOOLS_OPSYS),DARWIN)
ifeq ($(CCTOOLS_LINUX_NATIVE_X86_64),yes)
TARGETS = $(LIBRARIES) $(PROGRAMS)
else
TARGETS =
PROGRAMS =
else
TARGETS = $(LIBRARIES) $(PROGRAMS)
endif

all: $(TARGETS) bindings
Expand Down
2 changes: 2 additions & 0 deletions resource_monitor/src/rmonitor_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ int close(int fd)
return status;
}

#if defined(SYS_open)
static int open_for_writing(int fd)
{
int flags, access_mode;
Expand Down Expand Up @@ -369,6 +370,7 @@ int open64(const char *path, int flags, ...)
return fd;
}
#endif /* defined linux && __USE_LARGEFILE64 */
#endif /* defined SYS_open */

int socket(int domain, int type, int protocol)
{
Expand Down

0 comments on commit d2a9117

Please sign in to comment.