Hi folks,
I've been banging my head on buildworld for the past few days using releng/12.1 and stable/12; both just stock 'svn co', no modifications at all, building on a 12.1-RELEASE system, GENERIC kernel. Both fail during libpmc for 'undeclared identifier's, so I finally had some time to do some digging. It looks like a bug in the jevents.c logic when '.svn' directories exist (i.e. from a clone).
Example: Fresh "svn co https://svn.freebsd.org/base/stable/12/ ."
NOTE: I have tried without any '-j', same result, read on for example.
NOTE: I edited the shell paths for privacy sake, apologies if one doesn't make sense, the code and obj output both start at STABLE_12/ in the private paths
Checking the generated libpmc_events.c, the 'static' line has the trailing underscore, whereas the 'table' does not:
Insert lots of head scratching...
And I resorted to printf comments in jevents.c, ran 'make' to rebuild it, copied it to the obj dir, and re-ran it:
Result:
So it looks like process_mapfile vs process_one_file call file_name_to_table_name with a slightly different value.
I bet if I delete every '.svn' directory from my local copy, this will build, but that breaks the ability to do any svn update, etc, later of course.
I've also hunted around Google index results for the forums and mailing lists, but can't find anyone else having this problem which is strange if all 12.x branches have had this bug for awhile now.
Thoughts? Am I just building wrong on the newer version (12+); I've been using buildworld+buildkernel+custom edits for 6+ years now in 6, 8, & 10, no problems there.
Thanks in advance!
I've been banging my head on buildworld for the past few days using releng/12.1 and stable/12; both just stock 'svn co', no modifications at all, building on a 12.1-RELEASE system, GENERIC kernel. Both fail during libpmc for 'undeclared identifier's, so I finally had some time to do some digging. It looks like a bug in the jevents.c logic when '.svn' directories exist (i.e. from a clone).
Example: Fresh "svn co https://svn.freebsd.org/base/stable/12/ ."
NOTE: I have tried without any '-j', same result, read on for example.
NOTE: I edited the shell paths for privacy sake, apologies if one doesn't make sense, the code and obj output both start at STABLE_12/ in the private paths
C:
# make -j 16 buildworld
...
--- all_subdir_lib/libpmc ---
./pmu-events/jevents "x86" /tmp/STABLE_12/lib/libpmc/pmu-events/arch libpmc_events.c
...
--- all_subdir_lib/libpmc ---
libpmc_events.c:93065:11: error: use of undeclared identifier 'pme_broadwellde'; did you mean 'pme_broadwellde_'?
.table = pme_broadwellde
^~~~~~~~~~~~~~~
pme_broadwellde_
libpmc_events.c:16125:25: note: 'pme_broadwellde_' declared here
static struct pmu_event pme_broadwellde_[] = {
^
libpmc_events.c:93071:11: error: use of undeclared identifier 'pme_broadwell'; did you mean 'pme_broadwell_'?
.table = pme_broadwell
^~~~~~~~~~~~~
pme_broadwell_
libpmc_events.c:10441:25: note: 'pme_broadwell_' declared here
static struct pmu_event pme_broadwell_[] = {
^
libpmc_events.c:93077:11: error: use of undeclared identifier 'pme_broadwell'; did you mean 'pme_broadwell_'?
.table = pme_broadwell
^~~~~~~~~~~~~
pme_broadwell_
...
And several more for broadwellx, bonnell, etc, before it eventually fails out.
Checking the generated libpmc_events.c, the 'static' line has the trailing underscore, whereas the 'table' does not:
C:
...
static struct pmu_event pme_broadwellde_[] = { <<<< EDIT: Here
{
...
struct pmu_events_map pmu_events_map[] = {
{
.cpuid = "GenuineIntel-6-56",
.version = "v5",
.type = "core",
.table = pme_broadwellde <<<< EDIT: vs here
},
...
Insert lots of head scratching...
And I resorted to printf comments in jevents.c, ran 'make' to rebuild it, copied it to the obj dir, and re-ran it:
C:
In jevents.c
...
static int process_mapfile(FILE *outfp, char *fpath)
{
...
printf("DEBUG: process_mapfile file_name_to_table_name, fname = %s\n", fname);
tblname = file_name_to_table_name(fname);
printf("DEBUG: process_mapfile, tblname = %s\n", tblname);
fprintf(outfp, "{\n");
...
static int process_one_file(const char *fpath, const struct stat *sb,
int typeflag, struct FTW *ftwbuf)
{
...
printf("DEBUG: process_one_file file_name_to_table_name, bname = %s\n", bname);
tblname = file_name_to_table_name(bname);
printf("DEBUG: process_one_file, tblname = %s\n", tblname);
...
Result:
Bash:
[root@myservername /tmp/edit/path/removed/for/privacy/STABLE_12/amd64.amd64/lib/libpmc/pmu-events]# ./jevents "x86" /tmp/STABLE_12/lib/libpmc/pmu-events/arch libpmc_events.c
...
DEBUG: process_one_file file_name_to_table_name, bname = broadwellde/.svn
DEBUG: process_one_file, tblname = pme_broadwellde_ <<<< EDIT: Note the underscore!
...
DEBUG: process_mapfile file_name_to_table_name, fname = broadwellde
DEBUG: process_mapfile, tblname = pme_broadwellde <<<< EDIT: No underscore here
...
So it looks like process_mapfile vs process_one_file call file_name_to_table_name with a slightly different value.
I bet if I delete every '.svn' directory from my local copy, this will build, but that breaks the ability to do any svn update, etc, later of course.
I've also hunted around Google index results for the forums and mailing lists, but can't find anyone else having this problem which is strange if all 12.x branches have had this bug for awhile now.
Thoughts? Am I just building wrong on the newer version (12+); I've been using buildworld+buildkernel+custom edits for 6+ years now in 6, 8, & 10, no problems there.
Thanks in advance!