bugGNU roff - Bugs: bug #64910, build failure with clang++ on z/OS...

 
 

bug #64910: build failure with clang++ on z/OS (include assert.h _after_ config.h)

Submitter:  mike fulton <fultonm>
Submitted:  Sun 19 Nov 2023 09:11:06 PM UTC
   
 
Category:  General Severity:  3 - Normal
Item Group:  Build/Installation Status:  Need Info
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 13 Jan 2024 03:41:38 PM UTC, comment #5: 

Unassigning from self--"Need Info" status is waiting on submitter, not me.

G. Branden Robinson <gbranden>
Group administrator
Fri 08 Dec 2023 09:17:32 PM UTC, comment #4: 

Hi Mike,

Any word on this?

G. Branden Robinson <gbranden>
Group administrator
Mon 20 Nov 2023 07:15:19 AM UTC, comment #3: 

Hi Mike,

I've pushed.  Please let me know if this fixes the issue, or doesn't.


commit b28d9d05cac409842cd6387b544e39d36d9c3c01
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Nov 20 00:00:59 2023 -0600

    [build]: Fix Savannah #64910 ({assert,config}.h).

    In source files that #include <assert.h>, ensure that we #include
    <config.h> first (with a `HAVE_CONFIG_H` inclusion guard).  This should
    prevent build failures on AIX a.k.a. z/OS.

    * src/devices/grodvi/dvi.cpp:
    * src/devices/grolbp/lbp.cpp:
    * src/devices/grolj4/lj4.cpp:
    * src/include/itable.h:
    * src/include/ptable.h:
    * src/include/stringclass.h:
    * src/libs/libbib/linear.cpp:
    * src/libs/libbib/search.cpp:
    * src/libs/libdriver/printer.cpp:
    * src/libs/libgroff/color.cpp:
    * src/libs/libgroff/font.cpp:
    * src/libs/libgroff/fontfile.cpp:
    * src/libs/libgroff/nametoindex.cpp:
    * src/libs/libgroff/relocate.cpp:
    * src/libs/libgroff/searchpath.cpp:
    * src/preproc/eqn/box.cpp:
    * src/preproc/eqn/delim.cpp:
    * src/preproc/eqn/pile.cpp:
    * src/preproc/eqn/script.cpp:
    * src/preproc/html/pre-html.cpp:
    * src/preproc/pic/pic.h:
    * src/preproc/preconv/preconv.cpp:
    * src/preproc/soelim/soelim.cpp:
    * src/roff/groff/groff.cpp:
    * src/roff/troff/troff.h:
    * src/utils/hpftodit/hpftodit.cpp:
    * src/utils/indxbib/indxbib.cpp:
    * src/utils/lkbib/lkbib.cpp:
    * src/utils/lookbib/lookbib.cpp:
    * src/utils/tfmtodit/tfmtodit.cpp: Do it.

    Fixes <https://savannah.gnu.org/bugs/?64910>.  Also see
    <https://savannah.gnu.org/bugs/?61315>.  Thanks to Mike Fulton for the
    report.


G. Branden Robinson <gbranden>
Group administrator
Mon 20 Nov 2023 05:47:40 AM UTC, comment #2: 
G. Branden Robinson <gbranden>
Group administrator
Mon 20 Nov 2023 12:48:24 AM UTC, comment #1: 

Thanks for the report, Mike.  I'll work on this.

G. Branden Robinson <gbranden>
Group administrator
Sun 19 Nov 2023 09:11:06 PM UTC, original submission:  

I have hit a problem trying to build groff 1.23.0.
I am able to successfully build 1.22.4

The issue I am hitting is that there is a #include <assert.h> before the config.h file is included.
Unfortunately on z/OS, assert.h includes stdio.h and the stdio.h that is pulled in is from `lib/stdio.h`. The stdio.h references restrict which is properly defined to _restrict _ in config.h but it isn't included yet... This causes a nasty compiler error.

Looking at the preprocessed output for dvi.cpp, we can see:


# 1 "src/devices/grodvi/dvi.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 394 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "src/devices/grodvi/dvi.cpp" 2
# 19 "src/devices/grodvi/dvi.cpp"
# 1 "./lib/assert.h" 1
# 23 "./lib/assert.h" 3

# 1 "/c390/archive/zosv2r4/S2243/util/usr/include/assert.h" 1 3

# 40 "/c390/archive/zosv2r4/S2243/util/usr/include/assert.h" 3
# 1 "/c390/archive/zosv2r4/S2243/util/usr/include/features.h" 1 3
# 40 "/c390/archive/zosv2r4/S2243/util/usr/include/features.h" 3
extern "C" {
# 2185 "/c390/archive/zosv2r4/S2243/util/usr/include/features.h" 3
}
# 41 "/c390/archive/zosv2r4/S2243/util/usr/include/assert.h" 2 3
# 1 "./lib/stdio.h" 1 3
# 21 "./lib/stdio.h" 3
# 43 "./lib/stdio.h" 3


I confirmed that including config.h before the assert.h gave me a clean compile.

I have a directory of patches that worked for z/OS to fix this problem if that is useful: https://github.com/ZOSOpenTools/groffport/tree/bump-groff-version-1.23.0/patches/assertfix

Thanks, Mike Fulton

mike fulton <fultonm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by fultonm (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-13 gbranden Assigned togbranden None
    2023-11-20 gbranden StatusIn Progress Need Info
    2023-11-20 gbranden StatusNone In Progress
        Assigned toNone gbranden
        Summaryassert.h should be included after config.h : causes build failure with clang++ on z/OS build failure with clang++ on z/OS (include assert.h after config.h)

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code