Description
The build invokes linker with the .o from from libraries. This creates a different build result then invoking the linker with .a or .ar files for libraries, because files listed on linker command line are 'starting points' of compilation while objects from archives are added only if they are required by .o files from linker command line.
To reproduce, build for AVR the ImprovedKeyboard example of HID-Project library with Arduino IDE and with Sloeber. Then compare the size. Generate a .map file and you will see that the elf file created by Sloeber includes classes for all HID devices of the library while the elf file build by ArduinoIDE only contains the ImprovedKeyboard. (Additional problem is that in the sketch built by Sloeber all singeltons for HID devices are present and register themselves as USB endpoints, but there is space only for 3 endpoints. NicoHood/HID#199)
The build process should create archives (.a or .ar) for libraries and then add this archives on linker command line instead of listing the .o files.
To fix this, the makefile generation must be enhanced. I have Sloeber running from source code for debugging. I see that the makefile system is adaptation of the CDT makefile system, but before going deeper I thought I open an issue to discuss this.