Blame slurm_weak_symbols.patch

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