Skip to content

Commit

Permalink
Always define rd_ut_coverage_check
Browse files Browse the repository at this point in the history
Define `rd_ut_coverage_check` even in non-devel mode as the `lds-gen.py`
script adds the symbol unconditionally.

Otherwise LLD complains about ld:

```
error: version script assignment of 'global' to symbol 'rd_ut_coverage_check' failed: symbol not defined
```

Fixes #4593
  • Loading branch information
StephanDollberg committed Oct 4, 2024
1 parent 77622e2 commit b6a11e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/rdunittest.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ rd_ut_coverage_check(const char *file, const char *func, int line, int covnr) {
}
/**@}*/

#else

void rd_ut_coverage(const char * /* file */, const char * /* func */, int /* line */, int /* covnr */) {
}


int64_t
rd_ut_coverage_check(const char * /* file */, const char * /* func */, int /* line */, int /* covnr */) {
return 1;
}

#endif /* ENABLE_CODECOV */


Expand Down
8 changes: 4 additions & 4 deletions src/rdunittest.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ int rd_unittest(void);
* @{
*/

void rd_ut_coverage(const char *file, const char *func, int line, int covnr);
int64_t
rd_ut_coverage_check(const char *file, const char *func, int line, int covnr);

#if ENABLE_CODECOV

/* @define When adding new code coverages, use the next value and increment
Expand All @@ -209,10 +213,6 @@ int rd_unittest(void);
rd_ut_coverage_check(__FILE__, __FUNCTION__, __LINE__, COVNR)


void rd_ut_coverage(const char *file, const char *func, int line, int covnr);
int64_t
rd_ut_coverage_check(const char *file, const char *func, int line, int covnr);

#else

/* Does nothing if ENABLE_CODECOV is not set */
Expand Down

0 comments on commit b6a11e3

Please sign in to comment.