GCSORT 1.05.00 fails to parse command line
It's probably true for file_open_name, however there is also a potential race on file_cache ; I guess this one must stay global.
So, apparently -mminimal-toc is not enough, it gives me some errors: ".tc" only allowed inside ".toc" scope (might be a GCC/AIX bug) As for the test producing a C warning, I was able to reproduce it: IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99 COMP. PROCEDURE DIVISION. MOVE 263 TO X. GOBACK. When compiled with cobc -fno-trunc -x prog.cob, it yields: /tmp/cob14287358_0.c: In function 'prog_': /tmp/cob14287358_0.c:125:28: warning: unsigned conversion...
Hi Simon, @ddeclerck can you please elaborate on the following? On POSIX, we need to create the threads only after all jobs have been created, since job creation involves calls to non-thread-safe parts of libcob. The job creation loop in gcthread_start calls job_check, which calls cob_open. The main thread function gcthread_run calls job_loadFiles, which also calls cob_open. That function is not thread-safe (sharing file_open_name), which led to actual races and bugs. While it would be possible to...
Hi Simon, @ddeclerck can you please elaborate on the following? On POSIX, we need to create the threads only after all jobs have been created, since job creation involves calls to non-thread-safe parts of libcob. The job creation loop in gcthread_start calls job_check, which calls cob_open. The main thread function gcthread_run calls job_loadFiles, which also calls cob_open. That function is not thread-safe (sharing file_open_name), which let to actual races and bugs. While it would be possible to...
Hi @smenna, I made some modifications to GCSORT for AIX. You'll find them in the included patch. Several errors came from multithreading ; it seems AIX is not as forgiving as Linux when it comes to threads. I also adjusted the makefile so it allows to specify the GnuCOBOL path from the make invocation, defaulting to standard locations. Best regards, David P.S: credits to Claude for finding some very tricky bugs
Hi @smenna, I made some modifications to GCSORT for AIX. You'll find them in the included patch. Several errors came from multithreading ; it seems AIX is not as forgiving as Linux when it comes to threads. I also adjusted the makefile so it allows to specify the GnuCOBOL path from the make invocation, defaulting to standard locations. Best regards, David
To be more accurate about the options: -pthread is needed because libcob uses TLS ; without this option we have errors about an undefined .__tls_get_addr -Wl,-bbigtoc is needed to work around a linking error: ld: 0711-781 ERROR: TOC overflow. TOC size: 66520 Maximum size: 65536 - we just define too many symbols... -Wno-overflow is not strictly needed, it was to silence a warning when compiling one of our customer's test (I can't even reproduce that one today) As for the package itself, it is based...