Package: libf2c2 / 20240504-1

Metadata

Package Version Patches format
libf2c2 20240504-1 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001 upstream changelog.patch | (download)

changes | 3487 3487 + 0 - 0 !
1 file changed, 3487 insertions(+)

 upstream changelog


0002 makefile simplify two libs.patch | (download)

makefile.u | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 makefile simplify two libs


0003 C tweaks.patch | (download)

f2c.h0 | 24 22 + 2 - 0 !
uninit.c | 202 144 + 58 - 0 !
2 files changed, 166 insertions(+), 60 deletions(-)

 c tweaks


0004 add clapack files.patch | (download)

i_ceiling.c | 36 36 + 0 - 0 !
i_len_trim.c | 22 22 + 0 - 0 !
makefile.u | 2 2 + 0 - 0 !
3 files changed, 60 insertions(+)

 add clapack files

Adding two files that are part of clapack source
The clapack archive that can be downloaded at
  http://netlib.org/clapack/
contains a copy of f2c.  This copy is basically identical but it includes
two files which are missing in the source which was the base for the libf2c2
package.  Since the functions inside these files are used inside the test suite
of clapack the files were added here to avoid code duplication.

Add missing files also to makefile.u to get them built

0006 weak MAIN__.patch | (download)

main.c | 14 14 + 0 - 0 !
1 file changed, 14 insertions(+)

 weak main__

Make MAIN__ a weak symbol

Make MAIN__ a weak symbol, to make sure that non-f2c binaries can link
against libraries created by it. Also make main() a weak symbol, just
in case, because we really don't want to override a C program's main
routine.

Bug-Debian: https://bugs.debian.org/826253

0007 format security sprintf.patch | (download)

open.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 format security sprintf
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Squash potential buffer overflow noticed by GCC.  Note that even if
this is not an actual danger, a false positive can cause FTBFS in a
high security environment.

open.c: In function fk_open:
open.c:222:28: warning: %ld directive writing between 1 and 11 bytes into a region of size 5 [-Wformat-overflow=]
  (void) sprintf(nbuf,"fort.%ld",(long)n);
                            ^~~
open.c:222:22: note: directive argument in the range [-2147483648, 2147483647]
  (void) sprintf(nbuf,"fort.%ld",(long)n);
                      ^~~~~~~~~~
open.c:222:2: note: sprintf output between 7 and 17 bytes into a destination of size 10
  (void) sprintf(nbuf,"fort.%ld",(long)n);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0008 XintXX_t.patch | (download)

f2c.h0 | 47 14 + 33 - 0 !
1 file changed, 14 insertions(+), 33 deletions(-)

 xintxx_t

Instead of casing off on architectures, use int/uint _ 16/32/64.
See bugs.debian.org/800040

0009 F77_aloc type.patch | (download)

f77_aloc.c | 12 5 + 7 - 0 !
getenv_.c | 2 1 + 1 - 0 !
2 files changed, 6 insertions(+), 8 deletions(-)

 f77_aloc type

Be consistent about type of F77_aloc().  Ultimately it calls
malloc(size_t) so just use size_t for the length.

See bugs.debian.org/748989 which says:

... research compiler tool-chain ... which permits extended reporting
on type inconsistencies at link time.

[...]
gcc -shared -Wl,-soname,libf2c_i2.so.2\
                 -o libf2c_i2.so.2.1 *.o -lc -lm

error: conflicting function declarations "F77_aloc"
old definition in module f77_aloc file f77_aloc.c line 29
char * (signed int Len, const char *whence)
new definition in module getenv_ file getenv_.c line 11
char * (signed short int, const char *)
debian/make_lib:4: recipe for target 'all' failed
make[1]: *** [all] Error 64

The original declarations can be reviewed here:

http://sources.debian.net/src/libf2c2/20090411-2/f77_aloc.c?hl=14#L14
http://sources.debian.net/src/libf2c2/20090411-2/getenv_.c?hl=11#L11

It seems that the latter should be adjusted, replacing ftnlen by integer. One
may hope that the remaining bytes (for all systems with sizeof(short
int)<sizeof(int)) happen to be zero - but on big endian systems this should
yield some fun. (Not.)

0010 largefile_source redefinition.patch | (download)

sysdep1.h0 | 4 4 + 0 - 0 !
1 file changed, 4 insertions(+)

 largefile_source redefinition

Avoid re#definition of _LARGEFILE{,64}_SOURCE

0011 cross.patch | (download)

makefile.u | 3 2 + 1 - 0 !
1 file changed, 2 insertions(+), 1 deletion(-)

 cross

The file makefile.u hard codes the build architecture ld, which needs
to be made substitutable for cross compilation.