diff --git a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c index ca0341c1eb..08d7baaa61 100644 --- a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c +++ b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c @@ -60,6 +60,15 @@ #define BUFFER_SIZE 4096 +/* Declare these functions as weak in order to support full relro builds. */ +#if defined(__GNUC__) && defined(__ELF__) +/* TEST_CASE: sacct vs slurmctld */ +void build_array_str(struct job_record *job_ptr) __attribute__((weak)); +struct job_record *find_job_record(uint32_t job_id) __attribute__((weak)); +void lock_slurmctld (slurmctld_lock_t lock_levels) __attribute__((weak)); +void unlock_slurmctld (slurmctld_lock_t lock_levels) __attribute__((weak)); +#endif + /* These are defined here so when we link with something other than * the slurmctld we will have these symbols defined. They will get * overwritten when linking with the slurmctld. diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h index 33f9bcb05e..7bbd99f93d 100644 --- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h +++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h @@ -39,6 +39,9 @@ * Copyright (C) 2002 The Regents of the University of California. \*****************************************************************************/ +#ifndef __JOBACCT_GATHER_CGROUP_H__ +#define __JOBACCT_GATHER_CGROUP_H__ + #include "src/common/slurm_jobacct_gather.h" #include "src/common/xcgroup_read_config.h" #include "src/slurmd/common/xcgroup.h" @@ -76,3 +79,31 @@ extern int jobacct_gather_cgroup_memory_attach_task( /* pid_t pid, jobacct_id_t *jobacct_id); */ extern char* jobacct_cgroup_create_slurm_cg (xcgroup_ns_t* ns); + +/* Declare these functions as weak in order to support full relro builds. */ +#if defined(__GNUC__) && defined(__ELF__) +/* TEST_CASE: slurmctld vs slurmd */ +int xcgroup_add_pids(xcgroup_t* cg, pid_t* pids, int npids) + __attribute__((weak)); +int xcgroup_create(xcgroup_ns_t* cgns, xcgroup_t* cg, + char* uri, uid_t uid, gid_t gid) __attribute__((weak)); +int xcgroup_delete(xcgroup_t* cg) __attribute__((weak)); +void xcgroup_destroy(xcgroup_t* cg) __attribute__((weak)); +int xcgroup_get_param(xcgroup_t* cg, char* param, char **content, + size_t *csize) __attribute__((weak)); +int xcgroup_ns_create(slurm_cgroup_conf_t *conf, + xcgroup_ns_t* cgns, char* mnt_args, char* subsys) + __attribute__((weak)); +int xcgroup_instantiate(xcgroup_t* cg) __attribute__((weak)); +int xcgroup_lock(xcgroup_t* cg) __attribute__((weak)); +void xcgroup_ns_destroy(xcgroup_ns_t* cgns) __attribute__((weak)); +int xcgroup_set_param(xcgroup_t* cg, char* parameter, char* content) + __attribute__((weak)); +int xcgroup_set_uint32_param(xcgroup_t* cg, char* parameter, uint32_t value) + __attribute__((weak)); +int xcgroup_unlock(xcgroup_t* cg) __attribute__((weak)); +int xcpuinfo_fini(void) __attribute__((weak)); +int xcpuinfo_init(void) __attribute__((weak)); +#endif + +#endif /* __JOBACCT_GATHER_CGROUP_H__ */ diff --git a/src/plugins/jobacct_gather/common/common_jag.h b/src/plugins/jobacct_gather/common/common_jag.h index eff761638e..6a28a40af2 100644 --- a/src/plugins/jobacct_gather/common/common_jag.h +++ b/src/plugins/jobacct_gather/common/common_jag.h @@ -74,4 +74,11 @@ extern void jag_common_poll_data( List task_list, bool pgid_plugin, uint64_t cont_id, jag_callbacks_t *callbacks, bool profile); +/* Declare these functions as weak in order to support full relro builds. */ +#if defined(__GNUC__) && defined(__ELF__) +/* TEST_CASE: slurmctld vs slurmd */ +int proctrack_g_get_pids(uint64_t cont_id, pid_t **pids, int *npids) + __attribute__((weak)); +#endif + #endif diff --git a/src/plugins/node_features/knl_generic/node_features_knl_generic.c b/src/plugins/node_features/knl_generic/node_features_knl_generic.c index f87a685bfc..fb6b879896 100644 --- a/src/plugins/node_features/knl_generic/node_features_knl_generic.c +++ b/src/plugins/node_features/knl_generic/node_features_knl_generic.c @@ -113,6 +113,12 @@ #define DEFAULT_MCDRAM_SIZE ((uint64_t) 16 * 1024 * 1024 * 1024) #endif +/* Declare these functions as weak in order to support full relro builds. */ +#if defined(__GNUC__) && defined(__ELF__) +/* TEST_CASE: slurmctld vs slurmd */ +int ume_notify(void) __attribute__((weak)); +#endif + /* These are defined here so when we link with something other than * the slurmctld we will have these symbols defined. They will get * overwritten when linking with the slurmctld. diff --git a/src/plugins/select/cons_res/select_cons_res.h b/src/plugins/select/cons_res/select_cons_res.h index 0038d1c075..356a17950c 100644 --- a/src/plugins/select/cons_res/select_cons_res.h +++ b/src/plugins/select/cons_res/select_cons_res.h @@ -122,4 +122,15 @@ extern void cr_sort_part_rows(struct part_res_record *p_ptr); extern uint32_t cr_get_coremap_offset(uint32_t node_index); extern int cr_cpus_per_core(struct job_details *details, int node_inx); +/* Declare these functions as weak in order to support full relro builds. */ +#if defined(__GNUC__) && defined(__ELF__) +/* TEST_CASE: slurmd vs srun */ +int drain_nodes(char *nodes, char *reason, uint32_t reason_uid) + __attribute__((weak)); +uint32_t powercap_get_cluster_current_cap(void) __attribute__((weak)); +uint16_t slurm_job_preempt_mode(struct job_record *job_ptr) + __attribute__((weak)); +int which_power_layout(void) __attribute__((weak)); +#endif + #endif /* !_CONS_RES_H */ diff --git a/src/plugins/select/linear/select_linear.h b/src/plugins/select/linear/select_linear.h index a9b3bd2bf3..f06f580ccc 100644 --- a/src/plugins/select/linear/select_linear.h +++ b/src/plugins/select/linear/select_linear.h @@ -83,4 +83,11 @@ struct cr_record { uint16_t tot_job_len; /* length of tot_job_ids array */ }; +/* Declare these functions as weak in order to support full relro builds. */ +#if defined(__GNUC__) && defined(__ELF__) +/* TEST_CASE: slurmd vs srun */ +uint16_t slurm_job_preempt_mode(struct job_record *job_ptr) + __attribute__((weak)); +#endif + #endif /* !_SELECT_LINEAR_H */ diff --git a/src/plugins/select/serial/select_serial.h b/src/plugins/select/serial/select_serial.h index e88c49850b..7bea876bd1 100644 --- a/src/plugins/select/serial/select_serial.h +++ b/src/plugins/select/serial/select_serial.h @@ -111,4 +111,13 @@ extern struct node_use_record *select_node_usage; extern void cr_sort_part_rows(struct part_res_record *p_ptr); extern uint32_t cr_get_coremap_offset(uint32_t node_index); +/* Declare these functions as weak in order to support full relro builds. */ +#if defined(__GNUC__) && defined(__ELF__) +/* TEST_CASE: slurmd vs srun */ +int drain_nodes(char *nodes, char *reason, uint32_t reason_uid) + __attribute__((weak)); +uint16_t slurm_job_preempt_mode(struct job_record *job_ptr) + __attribute__((weak)); +#endif + #endif /* !_SELECT_SERIAL_H */