bugGNU roff - Bugs: bug #64994, math.h fails to compile on macOS...

 
 

bug #64994: math.h fails to compile on macOS 19 because it does not include config.h

Submitter:  None
Submitted:  Thu 07 Dec 2023 08:45:25 PM UTC
   
 
Category:  Core Severity:  4 - Important
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:19 PM UTC, comment #5: 

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

G. Branden Robinson <gbranden>
Group administrator
Tue 26 Dec 2023 08:13:13 PM UTC, comment #4: 

The "more improvements" promised in comment #2 were pushed a couple of weeks ago.

https://git.savannah.gnu.org/cgit/groff.git/commit/?id=dd6b4aada262b8bb858001905531e8be16e5bcad

Info required.  If someone could build groff Git's master branch on macOS >= 19.6, we can resolve this ticket if it's successful or reset its status to "Confirmed" if not.

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

Whoops--I failed to read the year associated with bug #61315.  This cannot be a duplicate of that bug because its fix also shipped with groff 1.23.0.

G. Branden Robinson <gbranden>
Group administrator
Fri 08 Dec 2023 09:15:44 PM UTC, comment #2: 

lib/math.h.in comes from gnulib so it's not a groff file proper.

I assume what's happening is that we're failing to get config.h #included in a groff .h or .cpp file.

This might already have been fixed in Git; see bug #61315 and bug #64910.  You might try cherry-picking the commits corresponding to those to see if either fixes the problem.  We had a similar issue in bug #60035, but shipped the fix for it in groff 1.23.0.

I see some further inconsistencies, so I have some more improvements pending.  You can expect them in my next push (later today, I hope).

G. Branden Robinson <gbranden>
Group administrator
Fri 08 Dec 2023 06:39:15 PM UTC, comment #1: 

Quoting attachment; it was tagged as "application/octet-stream", so it was a little hard to work with.


    Copyright (C) 1999-2020, 2022 Free Software Foundation, Inc.

    Copying and distribution of this file, with or without
    modification, are permitted in any medium without royalty provided
    the copyright notice and this notice are preserved.

                           groff Bug Report
GROFF VERSION:

GNU groff version 1.23.0
Copyright (C) 2022 Free Software Foundation, Inc.
GNU groff comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of groff and its subprograms
under the terms of the GNU General Public License.
For more information about these matters, see the file
named COPYING.

called subprograms:

GNU grops (groff) version 1.23.0
GNU troff (groff) version 1.23.0


PLATFORM:
Darwin doinks-MacBook-Air.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64


CONFIGURATION REPORT:

----------------------------------------------------------------------
 installation directory prefix    : /usr/local
 C++ compiler and options         : g++ -g -O2
 use libgroff's memory allocator  : no
 C compiler and options           : gcc -g -O2
 Perl interpreter version         : 5.34.0
 X11 support                      : disabled
 'groff -l' uses print spooler    : lpr
 use URW fonts for PDF output     : no
 preconv can use uchardet library : yes
 can build groff.dvi, groff.pdf   : no
----------------------------------------------------------------------


INPUT FILES:

Only used files part of the standard groff distribution.


COMMAND LINE:

make


DESCRIPTION OF INCORRECT BEHAVIOUR:

math.h fails to compile because it does not include config.h.

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:100:
./lib/math.h:58:3: error: "Please include config.h first."
 #error "Please include config.h first."
  ^
./lib/math.h:60:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN'
_GL_INLINE_HEADER_BEGIN
^
./lib/math.h:1673:1: error: expected unqualified-id
_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
^
./lib/stdlib.h:413:5: note: expanded from macro '_GL_CXXALIAS_SYS'
    _GL_EXTERN_C int _gl_cxxalias_dummy
    ^
./lib/stdlib.h:285:30: note: expanded from macro '_GL_EXTERN_C'
# define _GL_EXTERN_C extern "C"
                             ^
In file included from src/devices/grodvi/dvi.cpp:19:
In file included from ./lib/assert.h:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:44:
In file included from ./lib/stdlib.h:36:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:100:
./lib/math.h:3237:1: error: unknown type name '_GL_INLINE_HEADER_END'
_GL_INLINE_HEADER_END
^
In file included from src/devices/grodvi/dvi.cpp:19:
In file included from ./lib/assert.h:26:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:75:1: error: expected unqualified-id
__BEGIN_DECLS
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:71:32: note: expanded from macro '__BEGIN_DECLS'
#define __BEGIN_DECLS   extern "C" {
                               ^
src/devices/grodvi/dvi.cpp:304:5: error: use of undeclared identifier '__assert_rtn'
    assert(a == 0);
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:93:34: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                                 ^
src/devices/grodvi/dvi.cpp:963:7: error: use of undeclared identifier '__assert_rtn'
      assert(0);
      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:93:34: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                                 ^
7 errors generated.
make[1]: *** [src/devices/grodvi/dvi.o] Error 1
make: *** [all] Error 2


SUGGESTED FIX:

Have whichever program generates math.h add #include <config.h> in the
file.

--- lib/math.h        2023-12-07 13:19:09.000000000 -0700
+++ lib/mathold.h        2023-12-07 13:36:12.000000000 -0700
@@ -22,7 +22,6 @@
 #if !(defined __ANDROID__ && defined _LIBCPP_MATH_H && !defined INFINITY)

 #ifndef _GL_MATH_H
-#include <config.h>

 #if __GNUC__ >= 3
 #pragma GCC system_header


##### Editor settings
Local Variables:
fill-column: 72
mode: text
End:
vim: set filetype= textwidth=72:


G. Branden Robinson <gbranden>
Group administrator
Thu 07 Dec 2023 08:45:25 PM UTC, original submission:  

math.h fails to compile because it does not include config.h.
more information in the included BUG-REPORT file.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55419:  BUG-REPORT added by None (4KiB - application/octet-stream)

 

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)
  •  

    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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-13 gbranden Assigned togbranden None
    2023-12-26 gbranden StatusIn Progress Need Info
    2023-12-19 gbranden Summarymath.h fails to compile because it does not include config.h math.h fails to compile on macOS 19 because it does not include config.h
    2023-12-08 gbranden Severity3 - Normal 4 - Important
        Item GroupNone Build/Installation
        StatusNone In Progress
        Assigned toNone gbranden
    2023-12-07 None Attached File- Added BUG-REPORT, #55419

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code