From aa82a8894f38739c406bbab2bbef5182c2d6c741 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 18 May 2023 16:03:58 -0500 Subject: [PATCH] export: Use XCFLAGS64 for -q64 We currently use -q64 for a few commands in src/export on AIX, which becomes -m64 when using the clang-based xlc 17.1 compiler. Specify which flag to use in XCFLAGS64, and use that instead of hardcoding -q64 in those commands. Change-Id: Ia93aba9043dd9a24b1b0b4693ca498d75e8f6378 Reviewed-on: https://gerrit.openafs.org/15454 Reviewed-by: Cheyenne Wills Reviewed-by: Ben Huntsman Tested-by: BuildBot Reviewed-by: Michael Meffie --- src/cf/osconf.m4 | 4 ++++ src/export/Makefile.in | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 3c9ba20cd5..75e969304f 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -370,6 +370,7 @@ case $AFS_SYSNAME in MT_CC="xlc_r" SHLIB_SUFFIX="o" XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void" + XCFLAGS64=-q64 XLIBS="${LIB_AFSDB} ${LIB_libintl} -ldl" SHLIB_LINKER="${MT_CC} -bM:SRE -berok" AIX32="yes" @@ -385,6 +386,7 @@ case $AFS_SYSNAME in MT_CC="xlc_r" SHLIB_SUFFIX="o" XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void" + XCFLAGS64=-q64 XLIBS="${LIB_AFSDB} ${LIB_libintl} -ldl" SHLIB_LINKER="${MT_CC} -bM:SRE -berok" AIX32="no" @@ -410,12 +412,14 @@ case $AFS_SYSNAME in MT_CC="$CC" MT_CFLAGS="-pthread" XLDFLAGS="-Wl,-K" + XCFLAGS64=-m64 ], [ # Assume this is XL C 16.1 or earlier AC_MSG_RESULT([xlc]) MT_CC="xlc_r" XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void" + XCFLAGS64=-q64 ] ) diff --git a/src/export/Makefile.in b/src/export/Makefile.in index f10403097c..3ed60f7155 100644 --- a/src/export/Makefile.in +++ b/src/export/Makefile.in @@ -94,14 +94,14 @@ symtab.o symtab64.o: ${srcdir}/symtab.c rs_aix4* ) \ $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -c ${srcdir}/symtab.c ;; \ rs_aix5* ) \ - $(CC) $(AFS_CPPFLAGS) ${AFS_CFLAGS} -q64 -D__XCOFF64__ \ + $(CC) $(AFS_CPPFLAGS) ${AFS_CFLAGS} $(XCFLAGS64) -D__XCOFF64__ \ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV \ -c ${srcdir}/symtab.c ; \ mv symtab.o symtab64.o ; \ $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -DAFS_AIX51_ENV \ -c ${srcdir}/symtab.c ;; \ rs_aix[67]* ) \ - $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -q64 -D__XCOFF64__ \ + $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) $(XCFLAGS64) -D__XCOFF64__ \ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV \ -c ${srcdir}/symtab.c ; \ mv symtab.o symtab64.o ;; \ @@ -112,14 +112,14 @@ export.o export64.o: ${srcdir}/export.c rs_aix4* ) \ $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -c ${srcdir}/export.c ;; \ rs_aix5* ) \ - $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -q64 -D__XCOFF64__ \ + $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) $(XCFLAGS64) -D__XCOFF64__ \ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV \ -c ${srcdir}/export.c ; \ mv export.o export64.o ; \ $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -DAFS_AIX51_ENV \ -c ${srcdir}/export.c ;; \ rs_aix[67]* ) \ - $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -q64 \ + $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) $(XCFLAGS64) \ -D__XCOFF64__ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV \ -c ${srcdir}/export.c ; \ mv export.o export64.o ;; \ @@ -132,7 +132,7 @@ export.nonfs.o export64.nonfs.o: ${srcdir}/export.c -c ${srcdir}/export.c ; \ mv export.o export.nonfs.o ;; \ rs_aix5* ) \ - $(CC) $(CPPFLAGS) $(CFLAGS) -q64 ${INCS} -D__XCOFF64__ \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS64) ${INCS} -D__XCOFF64__ \ -DAFS_64BIT_KERNEL -DAFS_NONFSTRANS -DAFS_AIX51_ENV \ -c ${srcdir}/export.c ; \ mv export.o export64.nonfs.o ; \ @@ -140,7 +140,7 @@ export.nonfs.o export64.nonfs.o: ${srcdir}/export.c -DAFS_AIX51_ENV -c ${srcdir}/export.c ; \ mv export.o export.nonfs.o ;; \ rs_aix[67]* ) \ - $(CC) $(CPPFLAGS) $(CFLAGS) -q64 ${INCS} -D__XCOFF64__ \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS64) ${INCS} -D__XCOFF64__ \ -DAFS_64BIT_KERNEL -DAFS_NONFSTRANS -DAFS_AIX51_ENV \ -c ${srcdir}/export.c ; \ mv export.o export64.nonfs.o ;; \ @@ -151,7 +151,7 @@ cfgexport: cfgexport.o cfgexport64: cfgexport64.o if [ "x$(AIX64)" = "xyes" ]; then \ - $(CC) $(LDFLAGS) -g ${INCS} -q64 -o cfgexport64 cfgexport64.o ; \ + $(CC) $(LDFLAGS) -g ${INCS} $(XCFLAGS64) -o cfgexport64 cfgexport64.o ; \ fi cfgafs: cfgafs.o @@ -159,10 +159,10 @@ cfgafs: cfgafs.o cfgafs64: cfgafs64.o if [ "x$(AIX64)" = "xyes" ]; then \ - $(CC) $(LDFLAGS) -g ${INCS} -q64 -o cfgafs64 cfgafs64.o ; \ + $(CC) $(LDFLAGS) -g ${INCS} $(XCFLAGS64) -o cfgafs64 cfgafs64.o ; \ fi -CFLAGS_cfgexport64.o = -g -q64 -D__XCOFF64__ +CFLAGS_cfgexport64.o = -g $(XCFLAGS64) -D__XCOFF64__ cfgexport64.o: ${srcdir}/cfgexport.c AFS_component_version_number.c $(Q)if [ "x$(AIX64)" = "xyes" ]; then \ $(AFS_CCRULE_NOQ) $(srcdir)/cfgexport.c ; \ @@ -171,7 +171,7 @@ cfgexport64.o: ${srcdir}/cfgexport.c AFS_component_version_number.c cfgexport.o: ${srcdir}/cfgexport.c AFS_component_version_number.c cfgafs.o: ${srcdir}/cfgafs.c AFS_component_version_number.c -CFLAGS_cfgafs64.o = -q64 +CFLAGS_cfgafs64.o = $(XCFLAGS64) cfgafs64.o: ${srcdir}/cfgafs.c AFS_component_version_number.c $(Q)if [ "x$(AIX64)" = "xyes" ]; then \ $(AFS_CCRULE_NOQ) $(srcdir)/cfgafs.c ; \