Page MenuHomeFreeBSD

Fix amd64-gcc build
AbandonedPublic

Authored by lwhsu on Aug 26 2019, 1:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 1 2023, 8:18 PM
Unknown Object (File)
Oct 6 2023, 2:11 PM
Unknown Object (File)
Aug 27 2023, 2:31 PM
Unknown Object (File)
Aug 13 2023, 6:25 AM
Unknown Object (File)
Jun 21 2023, 9:49 PM
Unknown Object (File)
May 29 2023, 11:43 PM
Unknown Object (File)
Dec 25 2022, 9:29 PM
Subscribers

Details

Reviewers
kib
markj
Summary

Fix amd64-gcc build by removing declarations already in amd64/include/counter.h

Error messages:

/workspace/src/sys/amd64/amd64/pmap.c:446:21: error: redundant redeclaration of '__pcpu' [-Werror=redundant-decls]
 extern struct pcpu *__pcpu;
                     ^~~~~~
In file included from /workspace/src/sys/sys/counter.h:37:0,
                 from /workspace/src/sys/sys/vmmeter.h:65,
                 from /workspace/src/sys/amd64/amd64/pmap.c:130:
./machine/counter.h:36:21: note: previous declaration of '__pcpu' was here
 extern struct pcpu *__pcpu;
/workspace/src/sys/amd64/amd64/pmap.c:447:20: error: redundant redeclaration of 'temp_bsp_pcpu' [-Werror=redundant-decls]
 extern struct pcpu temp_bsp_pcpu;
                    ^~~~~~~~~~~~~
In file included from /workspace/src/sys/sys/counter.h:37:0,
                 from /workspace/src/sys/sys/vmmeter.h:65,
                 from /workspace/src/sys/amd64/amd64/pmap.c:130:
./machine/counter.h:37:20: note: previous declaration of 'temp_bsp_pcpu' was here
 extern struct pcpu temp_bsp_pcpu;
                    ^~~~~~~~~~~~~
Test Plan

make world and kernel with CROSS_TOOLCHAIN=amd64-gcc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26106
Build 24632: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/amd64/amd64/pmap.c
446

This line can be deleted too, it shadows a local var in pmap_bootstrap().

This revision is now accepted and ready to land.Aug 26 2019, 2:09 PM

I disagree with making pmap/pcpu define live in counter.h.

In D21417#466003, @kib wrote:

I disagree with making pmap/pcpu define live in counter.h.

I also feel these in counter.h is a bit odd, but we have extern struct pcpu __pcpu[]; in all sys/<arch>/include/counter.h

Is the right solution is removing all these definitions from all counter.h?

In D21417#466003, @kib wrote:

I disagree with making pmap/pcpu define live in counter.h.

I also feel these in counter.h is a bit odd, but we have extern struct pcpu __pcpu[]; in all sys/<arch>/include/counter.h

Is the right solution is removing all these definitions from all counter.h?

If it works, but I am sure it does not.

I have some plans about this stuff, I probably post something later today.

@kib : I found that this one and D21418 do not conflict, do you mind if I commit this first to fix gcc build?

This revision is now accepted and ready to land.Aug 27 2019, 9:54 AM

@kib : I found that this one and D21418 do not conflict, do you mind if I commit this first to fix gcc build?

Please do not.
I think you should have (or provide) a way to specify -Wno-error for emergency while the issues are sorted, for non-standard toolchain builds.