On 14.12.24 15:38, Matthias Klose wrote:
I tried to use the patches to build binary packages for Debian. Found
some issues:
tried to build libgcobol on more architectures, please find the attached
patch to disable building libgcobol on some architectures.
how should patches and build failures be reported at this point?
Matthias
the build currently fails on i386, armhf, s390x:
- on i386-linux:
In file included from ../../src/gcc/cobol/ec.h:35,
from ../../src/gcc/cobol/cdf.y:32:
../../src/gcc/cobol/symbols.h:283:23: error: enumerator value
'4294967296' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
283 | depends_on_e = 0x0100000000, // A group hierachy
contains a DEPENDING_ON
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:284:23: error: enumerator value
'8589934592' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
284 | initialized_e = 0x0200000000, // Don't call
parser_initialize from parser_symbol_add
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:285:23: error: enumerator value
'17179869184' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
285 | has_value_e = 0x0400000000, // Flag to hierarchical
descendents to ignore .initial
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:286:23: error: enumerator value
'34359738368' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
286 | ieeedec_e = 0x0800000000, // Indicates a FldFloat is
IEEE 754 decimal, rather than binary
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:287:23: error: enumerator value
'68719476736' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
287 | big_endian_e = 0x1000000000, // Indicates a value is
big-endian
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:288:23: error: enumerator value
'137438953472' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
288 | same_as_e = 0x2000000000, // Field produced by SAME
AS (cannot take new members)
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:289:23: error: enumerator value
'274877906944' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
289 | record_key_e = 0x4000000000,
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:290:23: error: enumerator value
'549755813888' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
290 | typedef_e = 0x8000000000, // IS TYPEDEF
| ^~~~~~~~~~~~
In file included from ../../src/gcc/cobol/cdf.y:85,
from cobol/cdf.c:249:
../../src/gcc/cobol/cdfval.h:80:3: error: 'cdfval_t::cdfval_t(int64_t)'
cannot be overloaded with 'cdfval_t::cdfval_t(long long int)'
80 | cdfval_t( int64_t value )
| ^~~~~~~~
on arm-linux-gnueabihf:
In file included from ../../src/gcc/cobol/ec.h:35,
from ../../src/gcc/cobol/cdf.y:32:
../../src/gcc/cobol/symbols.h:67:23: error: 'output' was not declared in
this scope
67 | static_assert( sizeof(output) == sizeof(long double), "long
doubles?" );
| ^~~~~~
../../src/gcc/cobol/symbols.h:69:8: error: '_Float128' is not supported
on this target
69 | static inline _Float128
| ^~~~~~
../../src/gcc/cobol/symbols.h:69:15: error: expected unqualified-id
before '_Float128'
69 | static inline _Float128
| ^~~~~~~~~
../../src/gcc/cobol/symbols.h:75:29: error: expected ',' or '...' before
'string'
75 | strfromf128 (char *restrict string, size_t size,
| ^~~~~~
../../src/gcc/cobol/symbols.h: In function 'int strfromf128(char*)':
../../src/gcc/cobol/symbols.h:77:20: error: 'str' was not declared in
this scope; did you mean 'std'?
77 | return strfroml(str, n, format, fp);
| ^~~
| std
../../src/gcc/cobol/symbols.h:77:25: error: 'n' was not declared in this
scope
77 | return strfroml(str, n, format, fp);
| ^
../../src/gcc/cobol/symbols.h:77:28: error: 'format' was not declared in
this scope
77 | return strfroml(str, n, format, fp);
| ^~~~~~
../../src/gcc/cobol/symbols.h:77:36: error: 'fp' was not declared in
this scope
77 | return strfroml(str, n, format, fp);
| ^~
../../src/gcc/cobol/symbols.h:75:20: warning: unused parameter
'restrict' [-Wunused-parameter]
75 | strfromf128 (char *restrict string, size_t size,
| ~~~~~~^~~~~~~~
../../src/gcc/cobol/symbols.h: At global scope:
../../src/gcc/cobol/symbols.h:283:23: error: enumerator value
'4294967296' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
283 | depends_on_e = 0x0100000000, // A group hierachy
contains a DEPENDING_ON
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:284:23: error: enumerator value
'8589934592' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
284 | initialized_e = 0x0200000000, // Don't call
parser_initialize from parser_symbol_add
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:285:23: error: enumerator value
'17179869184' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
285 | has_value_e = 0x0400000000, // Flag to hierarchical
descendents to ignore .initial
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:286:23: error: enumerator value
'34359738368' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
286 | ieeedec_e = 0x0800000000, // Indicates a FldFloat is
IEEE 754 decimal, rather than binary
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:287:23: error: enumerator value
'68719476736' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
287 | big_endian_e = 0x1000000000, // Indicates a value is
big-endian
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:288:23: error: enumerator value
'137438953472' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
288 | same_as_e = 0x2000000000, // Field produced by SAME
AS (cannot take new members)
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:289:23: error: enumerator value
'274877906944' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
289 | record_key_e = 0x4000000000,
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:290:23: error: enumerator value
'549755813888' is outside the range of underlying type 'size_t' {aka
'unsigned int'}
290 | typedef_e = 0x8000000000, // IS TYPEDEF
| ^~~~~~~~~~~~
../../src/gcc/cobol/symbols.h:419:44: error: '_Float128' is not
supported on this target
419 | const struct cbl_upsi_mask_t *upsi_mask;
| ^
../../src/gcc/cobol/symbols.h:420:5: error: expected unqualified-id
before '_Float128'
420 | _Float128 value;
| ^~~~~~~~~
../../src/gcc/cobol/symbols.h: In member function 'cbl_field_data_t&
cbl_field_data_t::valify()':
../../src/gcc/cobol/symbols.h:446:5: error: 'value' was not declared in
this scope
446 | value = strtof128( input, &pend );
| ^~~~~
../../src/gcc/cobol/symbols.h:446:13: error: 'strtof128' was not
declared in this scope; did you mean 'strtof32x'?
446 | value = strtof128( input, &pend );
| ^~~~~~~~~
| strtof32x
../../src/gcc/cobol/symbols.h: At global scope:
../../src/gcc/cobol/symbols.h:660:17: error: '_Float128' is not
supported on this target
660 | bool value_set( _Float128 value );
| ^
../../src/gcc/cobol/symbols.h:660:19: error: expected identifier before
'_Float128'
660 | bool value_set( _Float128 value );
| ^~~~~~~~~
../../src/gcc/cobol/symbols.h:660:19: error: '_Float128' is not
supported on this target
../../src/gcc/cobol/symbols.h:660:19: error: expected ',' or '...'
before '_Float128'
../../src/gcc/cobol/symbols.h: In member function 'cbl_field_t&
cbl_field_t::same_as(const cbl_field_t&, bool)':
../../src/gcc/cobol/symbols.h:621:12: error: 'struct cbl_field_data_t'
has no member named 'value'
621 | data.value = 0.0;
| ^~~~~
In file included from ../../src/gcc/cobol/cdf.y:85,
from cobol/cdf.c:249:
- on s390x-linux-gnu:
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:982:3: error: unsupported
non-standard suffix on floating constant
982 | if( value < -1.00Q || value > +1.00Q )
| ^~
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:982:3: error: unsupported
non-standard suffix on floating constant
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:985:5: error: unsupported
non-standard suffix on floating constant
985 | value = WEIRD_TRANSCENDENT_RETURN_VALUE;
| ^~~~~
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:1057:3: error: unsupported
non-standard suffix on floating constant
1057 | if( value < -1.0Q || value > +1.00Q )
| ^~
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:1057:3: error: unsupported
non-standard suffix on floating constant
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:1060:5: error: unsupported
non-standard suffix on floating constant
1060 | value = WEIRD_TRANSCENDENT_RETURN_VALUE;
| ^~~~~
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:1365:3: error: unsupported
non-standard suffix on floating constant
1365 | static _Float128 e = 2.7182818284590452353602874713526624977572Q;
| ^~~~~~
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:1403:3: error: unsupported
non-standard suffix on floating constant
1403 | value = powf128(10.0Q, value);
| ^~~~~
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:3168:3: error: unsupported
non-standard suffix on floating constant
3168 | static _Float128 pi = 3.141592653589793238462643383279502884Q;
| ^~~~~~
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:3197:9: error: unsupported
non-standard suffix on floating constant
3197 | if( arg1 <= -1.0Q )
| ^~
yes
checking syscall.h presence...
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:3202:9: error: unsupported
non-standard suffix on floating constant
3202 | discount = 1.0Q / (1.0Q + arg1);
| ^~~~~~~~
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:3202:9: error: unsupported
non-standard suffix on floating constant
/<<PKGBUILDDIR>>/src/libgcobol/intrinsic.cc:3561:3: error: unsupported
non-standard suffix on floating constant
3561 | if( value <= 0.0Q )
| ^~
--- a/configure.ac
+++ b/configure.ac
@@ -742,6 +742,23 @@ if test -d ${srcdir}/libphobos; then
fi
fi
+# Disable libgcobol on unsupported systems.
+# For testing, you can override this with --enable-libgcobol.
+if test -d ${srcdir}/libgcobol; then
+ if test x$enable_libgcobol = x; then
+ AC_MSG_CHECKING([for libgcobol support])
+ if (srcdir=${srcdir}/libgcobol; \
+ . ${srcdir}/configure.tgt; \
+ test "$LIBGCOBOL_SUPPORTED" != "yes")
+ then
+ AC_MSG_RESULT([no])
+ noconfigdirs="$noconfigdirs target-libgcobol"
+ else
+ AC_MSG_RESULT([yes])
+ fi
+ fi
+fi
+
# Disable Fortran for some systems.
case "${target}" in
mmix-*-*)
--- a/libgcobol/configure.ac
+++ b/libgcobol/configure.ac
@@ -33,6 +33,8 @@ AC_SUBST(VERSION)
# exported.
ORIGINAL_LD_FOR_MULTILIBS=$LD
+. ${srcdir}/configure.tgt
+
# -------
# Options
# -------
--- /dev/null
+++ b/libgcobol/configure.tgt
@@ -0,0 +1,63 @@
+# -*- shell-script -*-
+# Copyright (C) 2024 Free Software Foundation, Inc.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This is the target specific configuration file. This is invoked by the
+# autoconf generated configure script. Putting it in a separate shell file
+# lets us skip running autoconf when modifying target specific information.
+
+# Disable the libphobos or libdruntime components on untested or known
+# broken systems. More targets shall be added after testing.
+
+case "${target}" in
+ *-linux*)
+ # checked Linux targets not yet working:
+ # armel armhf i386 s390x
+ case "${target}" in
+ aarch64*-*-linux*)
+ LIBGCOBOL_SUPPORTED=yes
+ ;;
+ loongarch*-*-linux*)
+ LIBGCOBOL_SUPPORTED=yes
+ ;;
+ mips*-*-linux*)
+ LIBGCOBOL_SUPPORTED=yes
+ ;;
+ power*-*-linux*)
+ LIBGCOBOL_SUPPORTED=yes
+ ;;
+ riscv*-*-linux*)
+ LIBGCOBOL_SUPPORTED=yes
+ ;;
+ x86_64-*-linux*)
+ LIBGCOBOL_SUPPORTED=yes
+ ;;
+ arm*-linux*|hppa*-linux*|i?86-*-linux*|s390*-*-linux*)
+ # checked with Debian builds
+ LIBGCOBOL_SUPPORTED=no
+ ;;
+ *)
+ LIBGCOBOL_SUPPORTED=no
+ ;;
+ esac
+ ;;
+ *-gnu)
+ LIBGCOBOL_SUPPORTED=yes
+ ;;
+ *)
+ LIBGCOBOL_SUPPORTED=no
+ ;;
+esac