bugmake - Bugs: bug #58743, siggetmask should be called with...

 
 

bug #58743: siggetmask should be called with no arguments.

Submitted by:  None
Submitted on:  Fri 10 Jul 2020 06:28:55 AM UTC  
 
Severity:  3 - Normal Item Group:  Build/Install
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.3 Operating System:  POSIX-Based
Fixed Release:  SCM Triage Status:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sat 11 Jul 2020 04:46:08 AM UTC, comment #7: 

FYI I just pushed -C (empty) support to tcc git.
tcc has already several gcc compatible options that are accepted but dropped in order to support gcc plug and play replacement.

Now, with or without maintainer mode, gnumake compiles ROOTB from git with tcc.

Anonymous
Sat 11 Jul 2020 03:55:08 AM UTC, comment #6: 

That's fine with me.
I was using git to test your recent changes on Raspberry (arm) and now confirm it works well. I was not aware it builds gnumake in maintenance mode.

Thanks your for your help and support.

Christian

Anonymous
Fri 10 Jul 2020 07:07:39 PM UTC, comment #5: 

I forgot to say: this is only relevant for code checked out from Git.  It's actually not even possible to enable maintainer mode for release tarballs downloaded from ftp.gnu.org: the code for it isn't included in the release tarball.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 10 Jul 2020 07:06:22 PM UTC, comment #4: 

That flag is only used in maintenance mode, which has a number of requirements on the system AND ALSO adds a bunch of debugging code that will unquestionably slow down your GNU make program.

I strongly advise that you not use maintenance mode to build any version you want to use for anything other than developing GNU make itself.  The README.git file explains:

NOTE! This method builds GNU make in "maintainer mode".  Make programs built
      in this mode it will be slower, possibly MUCH slower: there are various
      sanity checks enabled.  Further this mode assumes a modern GCC, GNU
      libc, and well-formed system headers and enables a high level of
      warnings AND enables -Werror to turn warnings into failures.

      If you want to build from Git with "maintainer mode" disabled, add
      "MAKE_MAINTAINER_MODE=" to the make command line.  If you want to turn
      off the extra warning flags, add "MAKE_CFLAGS=" to the make command
      line.

      For example:
        $ ./configure
        $ make check MAKE_MAINTAINER_MODE= MAKE_CFLAGS=
        $ make install

I'm not sure I want to update the configure.ac to test for the -C option specifically and avoid it if not available, since it's only used in maintainer mode.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 10 Jul 2020 05:43:43 PM UTC, comment #3: 

Now works well with tcc and you last commit.
In fact, I had to remove -C (comment) gcc option which is not supported by tcc.

Maybe you should test if $(CC) supports -C.

I also tested on RPi 64bit which is aarch64 not arm.

Anonymous
Fri 10 Jul 2020 03:42:43 PM UTC, comment #2: 

I forgot to mention it is for RPi which is arm.
It may be related to: [bug #58347] Build failure on 32-bit ARM

Anonymous
Fri 10 Jul 2020 01:53:44 PM UTC, comment #1: 

Thanks, I will fix this.  The reason this doesn't show up on systems I test on is that this code is only run if the POSIX macro is not set.

The POSIX macro will be set if both HAVE_UNISTD_H is defined AND _POSIX_VERSION is defined (unless either ultrix of VMS are also defined).

I can't imagine why tcc on Linux causes this to not work.  I would assume that, unless you're also using some strange libc other than GNU libc which does not set _POSIX_VERSION, that it should be set regardless of the compiler.

I recommend you investigate the output of config.log to find out why these options are not set.

From makeint.h:

#ifdef  HAVE_UNISTD_H
# include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
   POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself!  */
# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
#  define POSIX 1
# endif
#endif

Then it gets undefined again but only on very old systems.

And in src/job.c:

#ifdef POSIX
  ...
#elif defined(HAVE_SIGSETMASK)
  ...

static void
unblock_sigs ()
{
  sigsetmask (siggetmask (0) & ~fatal_signal_mask)
}
  ...
#endif

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 10 Jul 2020 06:28:55 AM UTC, original submission:  

Hi,

Porting make with tcc compiler on Linux, I’ve found that siggetmask is called with argument 0 while it accepts none (see src/jobs.c)

It is defined in <signal.h> as:
extern int siggetmask (void) _THROW __attribute_deprecated_;

But src/jobs.c calls it this way.
static void
unblock_sigs ()
{
  sigsetmask (siggetmask (0) & ~fatal_signal_mask)
}

And tcc complains (with reasons):
src/job.c:507: error: too many arguments to function

Adding –Wall –Wextra also helps gcc to complain

Please note that sig[sg]etmask functions are deprecated.

While sigsetmask seems to always be defined with no arg, man siggetmask shows an int argument on Debian while it is removed in more recent Linux man pages like Fedora 32.

Changing siggetmask(0) to siggetmask() lets tcc to terminate compilation with a working make (I recompiled make with this one compiled by tcc).

Christian Jullien

Anonymous

 

(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 psmith (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-10 psmith StatusNone => Fixed
        Assigned toNone => psmith
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => SCM

    Back to the top


    Powered by Savane 3.5