Multiple definition discovered with espressif@6.5 but not with espressif@5.1.1

I discovered a strange difference buiding with espressif32@5.1.1 and espressif32@6.5.0

To explain the problem I made this small exemple.

platform = espressif32  ;@5.1.1
board = mhetesp32minikit
framework = espidf

here are the various files:

int test_int;
void foo();


#include "test.h"
void foo() {}


#include "test.h"
void app_main()

main.c is in the src folder
test is in the lib folder

If I buid with @5.1.1 no error
With @6.5.0 I get the multiple definition error on test_int which I guess is normal
the variable should be declared in test.c or defined as an extern variable.

The question is why is there no error buiding with the @5.1.1 ??

I did not test all the intermediate version between these two to see where it starts.
may be a change in the compiler or the linker.

Thanks a lot