XL C/C++ Compiler and Runtime Migration Guide for the Application Programmer

Total Page:16

File Type:pdf, Size:1020Kb

XL C/C++ Compiler and Runtime Migration Guide for the Application Programmer z/OS Version 2 Release 3 XL C/C++ Compiler and Runtime Migration Guide for the Application Programmer IBM GC14-7306-30 Note Before using this information and the product it supports, read the information in “Notices” on page 129. This edition applies to Version 2 Release 3 of z/OS (5650-ZOS) and to all subsequent releases and modifications until otherwise indicated in new editions. Last updated: 2019-02-15 © Copyright International Business Machines Corporation 1996, 2017. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About this document.............................................................................................xi z/OS XL C/C++ on the World Wide Web.................................................................................................... xix Where to find more information...........................................................................................................xix Technical support...................................................................................................................................... xix How to send your comments to IBM.........................................................................................................xix If you have a technical problem........................................................................................................... xx Part 1. Introduction............................................................................................... 1 Chapter 1. New migration issues for z/OS V2R3 XL C/C++.........................................................................3 Chapter 2. Program migration checklists.................................................................................................... 5 Before you start your migration............................................................................................................. 5 When you are compiling code................................................................................................................ 6 When you are binding program objects or load modules......................................................................7 When you are running an application ....................................................................................................7 Tools that facilitate your migration........................................................................................................ 9 The Edge Portfolio Analyzer..............................................................................................................9 Applicability of product information...................................................................................................... 9 Part 2. Migration of pre-OS/390 C/C++ applications to z/OS V2R3 XL C/C++.......... 11 Chapter 3. Source code compatibility issues with pre-OS/390 C/C++ programs................................... 13 Removal of IBM Open Class Library support.......................................................................................13 Source code modifications necessitated by changes in runtime library............................................ 13 The #pragma runopts directive......................................................................................................13 Resource allocation and memory management issues...................................................................... 13 The sizeof operator applied to a function return type................................................................... 14 A user-defined global new operator and array new.......................................................................14 Addressing incompatibilities................................................................................................................14 C/370 V2 main program and main entry point.............................................................................. 14 Pointer incompatibilities.................................................................................................................14 Data type incompatibilities.................................................................................................................. 15 Assignment restrictions for packed structures and unions...........................................................15 DSECT header files and packed structures....................................................................................15 Changes required by programs with interlanguage calls....................................................................15 Explicit program mask manipulations............................................................................................15 Assembler source code changes in System Programming C (SPC) applications built with EDCXSTRX..................................................................................................................................16 Internationalization incompatibilities..................................................................................................16 Support of alternate code points....................................................................................................16 Chapter 4. Compile-time issues with pre-OS/390 C/C++ programs........................................................17 Changes in compiler listings, messages, and return codes................................................................ 17 Macro redefinitions might result in severe errors..........................................................................17 Changes in compiler options................................................................................................................17 Compiler options that are no longer supported.............................................................................17 Compiler options that were introduced in OS/390 C/C++ or later................................................18 Changes in compiler option functionality.......................................................................................18 Changes that affect compiler invocations........................................................................................... 20 iii IPA compiler option and very large applications........................................................................... 21 Customized JCL and the CXX format..............................................................................................21 CBCI and CBCXI procedures in JCL............................................................................................... 21 Changes that affect SYSLIB DD cards..................................................................................................21 Change in SCLBH logical record length ......................................................................................... 21 Chapter 5. Bind-time migration issues with pre-OS/390 C/C++ programs............................................. 23 Library release level in use...................................................................................................................23 Binder invocation changes................................................................................................................... 25 Impact of changes to CC EXEC invocation syntax......................................................................... 25 Changes due to customizations of the runtime environment............................................................. 25 User-developed exit routines......................................................................................................... 25 Incompatibilities in external references..............................................................................................26 Requirements for relinking C/370 modules that invoke Debug Tool..................................................26 C/370 modules with interlanguage calls (ILC).................................................................................... 26 Interlanguage calls between assembler and PL/I language modules..........................................26 Function calls between C and Fortran modules............................................................................ 27 Function calls to and from COBOL modules.................................................................................. 27 Chapter 6. Runtime migration issues with pre-OS/390 C/C++ applications........................................... 31 Retention of pre-OS/390 runtime behavior.........................................................................................31 Runtime library messages....................................................................................................................31 Return codes and messages...........................................................................................................31 Error conditions that cause runtime messages............................................................................. 32 Prefixes of perror() and strerror() messages..................................................................................32 Language specification for messages............................................................................................ 32 User-developed exit routines......................................................................................................... 32 Changes that affect customized JCL procedures...............................................................................
Recommended publications
  • Managing Projects with GNU Make, Third Edition by Robert Mecklenburg
    ManagingProjects with GNU Make Other resources from O’Reilly Related titles Unix in a Nutshell sed and awk Unix Power Tools lex and yacc Essential CVS Learning the bash Shell Version Control with Subversion oreilly.com oreilly.com is more than a complete catalog of O’Reilly books. You’ll also find links to news, events, articles, weblogs, sample chapters, and code examples. oreillynet.com is the essential portal for developers interested in open and emerging technologies, including new platforms, pro- gramming languages, and operating systems. Conferences O’Reilly brings diverse innovators together to nurture the ideas that spark revolutionary industries. We specialize in document- ing the latest tools and systems, translating the innovator’s knowledge into useful skills for those in the trenches. Visit con- ferences.oreilly.com for our upcoming events. Safari Bookshelf (safari.oreilly.com) is the premier online refer- ence library for programmers and IT professionals. Conduct searches across more than 1,000 books. Subscribers can zero in on answers to time-critical questions in a matter of seconds. Read the books on your Bookshelf from cover to cover or sim- ply flip to the page you need. Try it today with a free trial. THIRD EDITION ManagingProjects with GNU Make Robert Mecklenburg Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo Managing Projects with GNU Make, Third Edition by Robert Mecklenburg Copyright © 2005, 1991, 1986 O’Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use.
    [Show full text]
  • Clangjit: Enhancing C++ with Just-In-Time Compilation
    ClangJIT: Enhancing C++ with Just-in-Time Compilation Hal Finkel David Poliakoff David F. Richards Lead, Compiler Technology and Lawrence Livermore National Lawrence Livermore National Programming Languages Laboratory Laboratory Leadership Computing Facility Livermore, CA, USA Livermore, CA, USA Argonne National Laboratory [email protected] [email protected] Lemont, IL, USA [email protected] ABSTRACT body of C++ code, but critically, defer the generation and optimiza- The C++ programming language is not only a keystone of the tion of template specializations until runtime using a relatively- high-performance-computing ecosystem but has proven to be a natural extension to the core C++ programming language. successful base for portable parallel-programming frameworks. As A significant design requirement for ClangJIT is that the runtime- is well known, C++ programmers use templates to specialize al- compilation process not explicitly access the file system - only gorithms, thus allowing the compiler to generate highly-efficient loading data from the running binary is permitted - which allows code for specific parameters, data structures, and so on. This capa- for deployment within environments where file-system access is bility has been limited to those specializations that can be identi- either unavailable or prohibitively expensive. In addition, this re- fied when the application is compiled, and in many critical cases, quirement maintains the redistributibility of the binaries using the compiling all potentially-relevant specializations is not practical. JIT-compilation features (i.e., they can run on systems where the ClangJIT provides a well-integrated C++ language extension allow- source code is unavailable). For example, on large HPC deploy- ing template-based specialization to occur during program execu- ments, especially on supercomputers with distributed file systems, tion.
    [Show full text]
  • Overview of LLVM Architecture of LLVM
    Overview of LLVM Architecture of LLVM Front-end: high-level programming language => LLVM IR Optimizer: optimize/analyze/secure the program in the IR form Back-end: LLVM IR => machine code Optimizer The optimizer’s job: analyze/optimize/secure programs. Optimizations are implemented as passes that traverse some portion of a program to either collect information or transform the program. A pass is an operation on a unit of IR code. Pass is an important concept in LLVM. LLVM IR - A low-level strongly-typed language-independent, SSA-based representation. - Tailored for static analyses and optimization purposes. Part 1 Part 1 has two kinds of passes: - Analysis pass (section 1): only analyze code statically - Transformation pass (section 2 & 3): insert code into the program Analysis pass (Section 1) Void foo (uint32_t int, uint32_t * p) { LLVM IR ... Clang opt } test.c test.bc stderr mypass.so Transformation pass (Section 2 & 3) mypass.so Void foo (uint32_t int, uint32_t * p) { ... LLVM IR opt LLVM IR } test.cpp Int main () { test.bc test-ins.bc ... Clang++ foo () ... LLVM IR } Clang++ main.cpp main.bc LLVM IR lib.cpp Executable lib.bc Section 1 Challenges: - How to traverse instructions in a function http://releases.llvm.org/3.9.1/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-function - How to print to stderr Section 2 & 3 Challenges: 1. How to traverse basic blocks in a function and instructions in a basic block 2. How to insert function calls to the runtime library a. Add the function signature to the symbol table of the module Section 2 & 3 Challenges: 1.
    [Show full text]
  • Software Extensibility and the System Object Model (SOM)
    Software Extensibility and the System Object Model (SOM) WWDC Release May 1996 © Apple Computer, Inc. 1992–1996 Apple Computer, Inc. Balloon Help, Chicago, Finder, Some states do not allow the exclusion © 1992–1996 Apple Computer, Inc. Geneva, Mac, and QuickDraw are or limitation of implied warranties or All rights reserved. trademarks of Apple Computer, Inc. liability for incidental or consequential damages, so the above limitation or No part of this publication may be IBM is a registered trademark of exclusion may not apply to you. This reproduced, stored in a retrieval International Business Machines warranty gives you specific legal rights, system, or transmitted, in any form Corporation. and you may also have other rights or by any means, mechanical, MacPaint and MacWrite are which vary from state to state.. electronic, photocopying, recording, registered trademarks, and or otherwise, without prior written Clarisworks is a trademark, of Claris permission of Apple Computer, Inc., Corporation. except to make a backup copy of NuBus is a trademark of Texas any documentation provided on Instruments. CD-ROM. PowerPC is a trademark of The Apple logo is a trademark of International Business Machines Apple Computer, Inc. Corporation, used under license Use of the “keyboard” Apple logo therefrom. (Option-Shift-K) for commercial UNIX is a registered trademark of purposes without the prior written Novell, Inc. in the United States and consent of Apple may constitute other countries, licensed exclusively trademark infringement and unfair through X/Open Company, Ltd. competition in violation of federal and state laws. Simultaneously published in the No licenses, express or implied, are United States and Canada.
    [Show full text]
  • Functional C
    Functional C Pieter Hartel Henk Muller January 3, 1999 i Functional C Pieter Hartel Henk Muller University of Southampton University of Bristol Revision: 6.7 ii To Marijke Pieter To my family and other sources of inspiration Henk Revision: 6.7 c 1995,1996 Pieter Hartel & Henk Muller, all rights reserved. Preface The Computer Science Departments of many universities teach a functional lan- guage as the first programming language. Using a functional language with its high level of abstraction helps to emphasize the principles of programming. Func- tional programming is only one of the paradigms with which a student should be acquainted. Imperative, Concurrent, Object-Oriented, and Logic programming are also important. Depending on the problem to be solved, one of the paradigms will be chosen as the most natural paradigm for that problem. This book is the course material to teach a second paradigm: imperative pro- gramming, using C as the programming language. The book has been written so that it builds on the knowledge that the students have acquired during their first course on functional programming, using SML. The prerequisite of this book is that the principles of programming are already understood; this book does not specifically aim to teach `problem solving' or `programming'. This book aims to: ¡ Familiarise the reader with imperative programming as another way of imple- menting programs. The aim is to preserve the programming style, that is, the programmer thinks functionally while implementing an imperative pro- gram. ¡ Provide understanding of the differences between functional and imperative pro- gramming. Functional programming is a high level activity.
    [Show full text]
  • Proceedings of the Rexx Symposium for Developers and Users
    SLAC-R-95-464 CONF-9505198-- PROCEEDINGS OF THE REXX SYMPOSIUM FOR DEVELOPERS AND USERS May 1-3,1995 Stanford, California Convened by STANFORD LINEAR ACCELERATOR CENTER STANFORD UNIVERSITY, STANFORD, CALIFORNIA 94309 Program Committee Cathie Dager of SLAC, Convener Forrest Garnett of IBM Pam Taylor of The Workstation Group James Weissman Prepared for the Department of Energy under Contract number DE-AC03-76SF00515 Printed in the United States of America. Available from the National Technical Information Service, U.S. Department of Commerce, 5285 Port Royal Road, Springfield, Virginia 22161. DISTRIBUTION OF THIS DOCUMENT IS UNLIMITED ;--. i*-„r> ->&• DISCLAIMER This report was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor any agency thereof, nor any of their employees, make any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof. DISCLAIMER Portions
    [Show full text]
  • Compiling a Higher-Order Smart Contract Language to LLVM
    Compiling a Higher-Order Smart Contract Language to LLVM Vaivaswatha Nagaraj Jacob Johannsen Anton Trunov Zilliqa Research Zilliqa Research Zilliqa Research [email protected] [email protected] [email protected] George Pîrlea Amrit Kumar Ilya Sergey Zilliqa Research Zilliqa Research Yale-NUS College [email protected] [email protected] National University of Singapore [email protected] Abstract +----------------------+ Scilla is a higher-order polymorphic typed intermediate | Blockchain Smart | | Contract Module | level language for implementing smart contracts. In this talk, | in C++ (BC) | +----------------------+ we describe a Scilla compiler targeting LLVM, with a focus + state variable | + ^ on mapping Scilla types, values, and its functional language foo.scilla | | | & message | fetch| | constructs to LLVM-IR. | | |update v v | The compiled LLVM-IR, when executed with LLVM’s JIT +--------------------------------------+---------------------------------+ framework, achieves a speedup of about 10x over the refer- | | | +-------------+ +----------------+ | ence interpreter on a typical Scilla contract. This reduced | +-----------------> |JIT Driver | +--> | Scilla Run-time| | | | |in C++ (JITD)| | Library in C++ | | latency is crucial in the setting of blockchains, where smart | | +-+-------+---+ | (SRTL) | | | | | ^ +----------------+ | contracts are executed as parts of transactions, to achieve | | | | | | | foo.scilla| | | peak transactions processed per second. Experiments on the | | | foo.ll| | | | | | | Ackermann
    [Show full text]
  • X Window System Version 6.4.2 Release Notes
    X Window System Version 6.4.2 Release Notes October 2000 0890298-6.4.2 READREAD MEME BEFOREBEFORE INSTALLINGINSTALLING THISTHIS PRODUCTPRODUCT Copyright Copyright 2000 by Concurrent Computer Corporation. All rights reserved. This publication or any part thereof is intended for use with Concurrent Computer Corporation products by Concurrent Computer Corporation personnel, customers, and end–users. It may not be reproduced in any form without the written permission of the publisher. Disclaimer The information contained in this document is subject to change without notice. Concurrent Computer Corporation has taken efforts to remove errors from this document, however, Concurrent Computer Corporation’s only liability regarding errors that may still exist is to correct said errors upon their being made known to Concurrent Computer Corporation. Concurrent Computer Corporation assumes no responsibility for the use or reliability of software if used on equipment that is not supplied by Concurrent Computer Corporation. License The software described in this document is furnished under a license, and it can be used or copied only in a manner permitted by that license. Any copy of the described software must include any copyright notice, trademarks or other legends or credits of Concurrent Computer Corporation and/or its suppliers. Title to and ownership of the described software and any copies thereof shall remain in Concurrent Computer Corporation and/or its suppliers. The licensed software described herein may contain certain encryptions or other devices which may prevent or detect unauthorized use of the Licensed Software. Temporary use permitted by the terms of the License Agreement may require assistance from Concurrent Computer Corporation.
    [Show full text]
  • Using ID TECH Universal SDK Library Files in a C++ Project
    Using ID TECH Universal SDK Library Files in a C++ Project Introduction From time to time, customers who wish to use ID TECH's Universal SDK for Windows (which is .NET-based and comes with C# code examples) ask if it is possible to do development against the SDK solely in C++ (on Windows). The answer is yes. Universal SDK library files (DLLs) are COM-visible and ready to be accessed from C++ code. (SDK runtimes require the .NET Common Language Runtime, but your C++ binaries can still use the SDK.) Note that while the example shown in this document involves Microsoft's Visual Studio, it is also possible to use SDK libraries in C++ projects created in Eclipse or other IDEs. How to Use the IDTechSDK.dll File in a C++ Project: 1. Create a Visual C++ project in Visual Studio 2015 (shown below, an MFC Application as an example). 2. Change the properties of the Visual C++ project. Under the General tag, set Commom Language Runtime Support under Target Platform to "Common Language Runtime Support (/clr)" under Windows. 3. Under VC++ Directories, add the path to the C# .dll file(s) to Reference Directories. 4. Under C/C++ General, set Commom Language Runtime Support to "Common Language Runtime Support (/clr)." 5. Under C/C++ Preprocessor, add _AFXDLL to Preprocessor Definitions. 6. Under C/C++ Code Generation, change Runtime Library to "Multi-threaded DLL (/MD)." 7. Under Code Analysis General, change Rule Set to "Microsoft Mixed (C++ /CLR) Recommended Rules." 8. Use IDTechSDK.dll in your .cpp file. a.
    [Show full text]
  • Using Ld the GNU Linker
    Using ld The GNU linker ld version 2 January 1994 Steve Chamberlain Cygnus Support Cygnus Support [email protected], [email protected] Using LD, the GNU linker Edited by Jeffrey Osier (jeff[email protected]) Copyright c 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another lan- guage, under the above conditions for modified versions. Chapter 1: Overview 1 1 Overview ld combines a number of object and archive files, relocates their data and ties up symbol references. Usually the last step in compiling a program is to run ld. ld accepts Linker Command Language files written in a superset of AT&T’s Link Editor Command Language syntax, to provide explicit and total control over the linking process. This version of ld uses the general purpose BFD libraries to operate on object files. This allows ld to read, combine, and write object files in many different formats—for example, COFF or a.out. Different formats may be linked together to produce any available kind of object file. See Chapter 5 [BFD], page 47, for more information. Aside from its flexibility, the gnu linker is more helpful than other linkers in providing diagnostic information.
    [Show full text]
  • Performance Analyses and Code Transformations for MATLAB Applications Patryk Kiepas
    Performance analyses and code transformations for MATLAB applications Patryk Kiepas To cite this version: Patryk Kiepas. Performance analyses and code transformations for MATLAB applications. Computa- tion and Language [cs.CL]. Université Paris sciences et lettres, 2019. English. NNT : 2019PSLEM063. tel-02516727 HAL Id: tel-02516727 https://pastel.archives-ouvertes.fr/tel-02516727 Submitted on 24 Mar 2020 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Préparée à MINES ParisTech Analyses de performances et transformations de code pour les applications MATLAB Performance analyses and code transformations for MATLAB applications Soutenue par Composition du jury : Patryk KIEPAS Christine EISENBEIS Le 19 decembre 2019 Directrice de recherche, Inria / Paris 11 Présidente du jury João Manuel Paiva CARDOSO Professeur, University of Porto Rapporteur Ecole doctorale n° 621 Erven ROHOU Ingénierie des Systèmes, Directeur de recherche, Inria Rennes Rapporteur Matériaux, Mécanique, Michel BARRETEAU Ingénieur de recherche, THALES Examinateur Énergétique Francois GIERSCH Ingénieur de recherche, THALES Invité Spécialité Claude TADONKI Informatique temps-réel, Chargé de recherche, MINES ParisTech Directeur de thèse robotique et automatique Corinne ANCOURT Maître de recherche, MINES ParisTech Co-directrice de thèse Jarosław KOŹLAK Professeur, AGH UST Co-directeur de thèse 2 Abstract MATLAB is an interactive computing environment with an easy programming language and a vast library of built-in functions.
    [Show full text]
  • Meson Manual Sample.Pdf
    Chapter 2 How compilation works Compiling source code into executables looks fairly simple on the surface but gets more and more complicated the lower down the stack you go. It is a testament to the design and hard work of toolchain developers that most developers don’t need to worry about those issues during day to day coding. There are (at least) two reasons for learning how the system works behind the scenes. The first one is that learning new things is fun and interesting an sich. The second one is that having a grasp of the underlying system and its mechanics makes it easier to debug the issues that inevitably crop up as your projects get larger and more complex. This chapter aims outline how the compilation process works starting from a single source file and ending with running the resulting executable. The information in this chapter is not necessary to be able to use Meson. Beginners may skip it if they so choose, but they are advised to come back and read it once they have more experience with the software build process. The treatise in this book is written from the perspective of a build system. Details of the process that are not relevant for this use have been simplified or omitted. Entire books could (and have been) written about subcomponents of the build process. Readers interested in going deeper are advised to look up more detailed reference works such as chapters 41 and 42 of [10]. 2.1 Basic term definitions compile time All operations that are done before the final executable or library is generated are said to happen during compile time.
    [Show full text]