Ticket #1943 (new bug)

Opened 4 years ago

Last modified 4 years ago

Failure due to missing external definition of inlined functions

Reported by: doughera Owned by:
Priority: major Milestone:
Component: configure Version: 2.11.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: solaris

Description

As of version RELEASE_2_11_0-902-gdce9186, attempting to build parrot with Sun's compiler under Linux fails with the following errors:

/tmp/parrot/blib/lib/libparrot.so: undefined reference to `Parrot_pmc_box_integer'
/tmp/parrot/blib/lib/libparrot.so: undefined reference to `Parrot_pmc_box_string'
/tmp/parrot/blib/lib/libparrot.so: undefined reference to `Parrot_pmc_box_number'

The problem is a reappearance of TT #1646. There really seem to be three separate issues:

1. The config::auto inline test does not test the inline keyword in the way that parrot ultimately uses it. (It specifies neither static nor external, and is in the same file as it is ultimately used.) It is relevant to note that gcc -std=c99 won't accept the current inline test files either. A correct test would test the way that inline is intended to actually be used. If parrot wants to assume that inline functions also have external linkage, then the tests should be written to test for this. Note that traditional GNU inline behavior is different from C99 behavior. A good discussion of these issues is at  http://www.greenend.org.uk/rjk/2003/03/inline.html. (In perl 5, we test for and use only static inline . Feel free to copy those tests.)

2. The result of the configure test is, in some cases, ignored anyway. Specifically, if the compiler passes the second test for __inline , the following code in config/gen/config_h/feature_h.in unconditionally uses a plain inline anyway, even though Configure determined that didn't work:

#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#  define PARROT_INLINE inline
#  define PARROT_HAS_INLINE
#else
#  define PARROT_INLINE
#endif

3. The functions above are never declared 'extern'.

Change History

Changed 4 years ago by doughera

This is still present in 3.0.0.

Changed 4 years ago by dukeleto

  • priority changed from normal to major
  • platform set to solaris
  • component changed from none to configure
Note: See TracTickets for help on using tickets.