Skip to main content
  1. Posts/

Problems and solutions when upgrading XLC from 10.1 to IBM Open XL C/C++ for AIX 17.1.0

·298 words·2 mins· ·
Xianpeng Shen
Author
Xianpeng Shen
DevOps & Build Engineer | Python Enthusiast | Open Source Maintainer
Table of Contents

In this article, I would like to document the problems encountered when upgrading from IBM XLC 10.1 to XLC 17.1 (IBM Open XL C/C++ for AIX 17.1.0) and how to fix the following 12 errors.

If you’ve encountered any other errors, feel free to share your comments with or without a solution.

1. Change cc to ibm-clang
#

First you need to change all the related cc to ibm-clang in the the global Makefile. for example:

- CC=cc
- CXX=xlC_r
- XCC=xlC_r
- MAKE_SHARED=xlC_r
+ CC=ibm-clang
+ CXX=ibm-clang_r
+ XCC=ibm-clang_r
+ MAKE_SHARED=ibm-clang_r

And check following link of Mapping of options to map new Clang options if any.

2. error: unknown argument: ‘-qmakedep=gcc’
#

- GEN_DEPENDENTS_OPTIONS=-qmakedep=gcc  -E -MF $@.1 > /dev/null
+ GEN_DEPENDENTS_OPTIONS= -E -MF $@.1 > /dev/null

3. should not return a value [-Wreturn-type]
#

- return -1;
+ return;

4. error: non-void function ‘main’ should return a value [-Wreturn-type]
#

- return;
+ return 0;

5. error: unsupported option ‘-G’ for target ‘powerpc64-ibm-aix7.3.0.0’
#

- LIB_101_FLAGS := -G
+ LIB_101_FLAGS := -shared -Wl,-G

6. Undefined symbol (libxxxx.so)
#

- LIB_10_FLAGS := -bexport:$(SRC)/makefiles/xxxx.def
+ LIB_10_FLAGS := -lstdc++ -lm -bexport:$(SRC)/makefiles/xxxx.def

7. unsupported option -qlongdouble
#

- drv_connect.c.CC_OPTIONS=$(CFLAGS) -qlongdouble -brtl
+ drv_loadfunc.c.CC_OPTIONS=$(CFLAGS) $(IDIR) -brtl

8. Undefined symbol: ._Z8u9_closei
#

- extern int u9_close(int fd) ;
+ extern "C" int u9_close(int fd) ;

9. ERROR: Undefined symbol: .pow
#

- CXXLIBES = -lpthread -lC -lstdc++
+ CXXLIBES = -lpthread -lC -lstdc++ -lm

10. ‘main’ (argument array) must be of type ‘char **’
#

- d_char *argv[];
+ char *argv[];

11. first parameter of ‘main’ (argument count) must be of type ‘int’
#

- int main(char *argc, char *argv[])
+ int main(int argc, char *argv[])

12. ERROR: Undefined symbol: ._ZdaPv
#

- LIB_3_LIBS	:= -lverse -llog_nosig
+ LIB_3_LIBS	:= -lverse -llog_nosig -lstdc++

Related

Solving Two Git Clone Failure Issues on AIX
·878 words·5 mins
This article documents two issues encountered when using Jenkins for Git clone on AIX and their solutions, including dependent library loading failure and SSH authentication failure.
Resolving Git Large Repository Download Failures on AIX by Removing File Resource Limits
·368 words·2 mins
Resolving Git large repository download failures on AIX due to file size limits by modifying ulimit settings.
Resolving Jenkins Artifactory Plugin Artifact Upload Failure "unable to find valid certification path to requested target"
·369 words·1 min
This article describes how to resolve SSL certificate validation issues when uploading artifacts from a Jenkins agent to Artifactory, including generating a security certificate file and importing it into Java’s cacerts.
Upload artifacts failed to Artifactory from AIX
·784 words·4 mins
This article explains how to resolve an SSL certificate verification issue on AIX when uploading artifacts to Artifactory via Jenkins, including updating Java’s cacerts file.
Creating a NuGet Organization — Pitfalls Encountered
·307 words·1 min
This article documents the problems and solutions encountered when creating a NuGet Organization, especially regarding the use of corporate email addresses.
Docker Buildx Bake—A Powerful Tool for Accelerating Builds and Managing Multi-platform Images
·987 words·2 mins
This article introduces the concept, advantages, use cases, and how to use Docker Buildx Bake to accelerate the building and management of multi-platform images.