Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork436
Improve precompiled libraries handling#512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
General change: - library compilation bails out if the precompiled object is found. This allows mixed libraries that fallback using sources if no suitable precompiled object is foundARM float specification change: - Cortex M4+ allows specifying different flags for floating point ABI This patch introduces a second level of subfolder that MUST be used is -mfpu or -mfloat-abi are specified on the commandline Since there's no clear specification (unlike build.mcu), the values are extracted from c++ recipe For example, for a target which commandline contains `-mfloat-abi=hard -mfpu=fpv4-sp-d16` , the precompiled search path will be `$libfolder/cortex-m4/fpv4-sp-d16-hard` If that folder doesn't exist the library will be compiled from sourcesFixesarduino/arduino-builder#256
sandeepmistry commentedDec 12, 2019
Unfortunately this is not working for me with the For the Arduino Nano 33 BLE, I see the following: when compiling the however when compiling for the MKR Zero, I get linker errors: Note the following changes are needed to the sketch: |
facchinm commentedDec 12, 2019
@sandeepmistry that's because you need a specially crafted version of tflite library with the |
sandeepmistry commentedDec 12, 2019
@facchinm of course! Totally my bad :) ... the zip you provided links perfectly for MKR Zero! |
ladyada commentedDec 16, 2019
hi folks, is there a way i could test the PR? |
ladyada commentedDec 26, 2019
hihi folks checkin' in again if there's anything i can do to help test this PR |
cmaglie commentedJan 30, 2020
If not needed maybe it's better to remove it, there are known use cases? |
cmaglie left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Besides the.a with non-standard name (that was already handled so it's not part of this pr) LGTM
- Fix library priority selection (again)arduino/arduino-cli#574- Improve precompiled libraries handlingarduino/arduino-cli#512
This patch restores some functionalities broken byarduino#512 .It introduces a BREAKING CHANGE to "precompiled" fieldIf merged, "precompiled" means that the library ONLY contains a precompiled library and its headers.No file containing implementation will be compiled if the library is specified as such.Fixesarduino/arduino-builder#353Tested with*arduino#512 (comment) (Nano33BLE and generic MKR board)*https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties)*https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken byarduino#512 .It introduces a BREAKING CHANGE to "precompiled" fieldIf merged, "precompiled" means that the library ONLY contains a precompiled library and its headers.No file containing implementation will be compiled if the library is specified as such.Tested with*arduino#512 (comment) (Nano33BLE and generic MKR board)*https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties)*https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken byarduino#512 .It introduces a BREAKING CHANGE to "precompiled" fieldIf merged, "precompiled" means that the library ONLY contains a precompiled library and its headers.No file containing implementation will be compiled if the library is specified as such.Fixesarduino/arduino-builder#353Tested with*arduino#512 (comment) (Nano33BLE and generic MKR board)*https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties)*https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken byarduino#512 .It introduces a BREAKING CHANGE to "precompiled" fieldIf merged, "precompiled" means that the library ONLY contains a precompiled library and its headers.No file containing implementation will be compiled if the library is specified as such.Fixesarduino/arduino-builder#353Tested with*arduino#512 (comment) (Nano33BLE and generic MKR board)*https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties)*https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken byarduino#512 .It introduces a BREAKING CHANGE to "precompiled" fieldIf merged, "precompiled" means that the library ONLY contains a precompiled library and its headers.No file containing implementation will be compiled if the library is specified as such.Fixesarduino/arduino-builder#353Tested with*arduino#512 (comment) (Nano33BLE and generic MKR board)*https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties)*https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken byarduino#512 .It introduces a BREAKING CHANGE to "precompiled" fieldIf merged, "precompiled" means that the library ONLY contains a precompiled library and its headers.No file containing implementation will be compiled if the library is specified as such.Fixesarduino/arduino-builder#353Tested with*arduino#512 (comment) (Nano33BLE and generic MKR board)*https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties)*https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
* Fix mixed code precompiled librariesThis patch restores some functionalities broken by#512 .It introduces a BREAKING CHANGE to "precompiled" fieldIf merged, "precompiled" means that the library ONLY contains a precompiled library and its headers.No file containing implementation will be compiled if the library is specified as such.Fixesarduino/arduino-builder#353Tested with*#512 (comment) (Nano33BLE and generic MKR board)*https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties)*https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)* Added test-build for Arduino_TensorFlowLite* Added another test for Bosch Sensor lib* Fallback search for precompiled libraries in non-fpu specific directories* variable renamed* Moved fixLDFLAG inside compileLibraries* Inlined FixLDflags* Using more paths helpers to simplify code* Added support for "precompiled=full" in library.propertiesThis flag allow the deployment of a pure precompiled library that shipsalso the source code of the precompiled part.This allows to possibly compile-from-source as a fallback if the librarydoes not provide a precompiled build for the current architecture.The "precompiled=true" instead has been ported back to the old behaviour(for libraries that ships a precompiled binary and support source codethat wraps/uses the precompiled part).* Updated tests* Fixed test compile-build on very long paths on Windows* Removed constants.BUILD_PROPERTIES_COMPILER_LIBRARIES_LDFLAGS* Add space before "-L" gcc flag to allow multiple precompiled libs to be includedCo-authored-by: Cristian Maglie <c.maglie@arduino.cc>
General change:
This allows mixed libraries that fallback using sources if no suitable precompiled object is found
ARM float specification change:
Cortex M4+ allows specifying different flags for floating point ABI
This patch introduces a second level of subfolder that MUST be used if -mfpu or -mfloat-abi are specified on the commandline
Since there's no clear specification (unlike build.mcu), the values are extracted from c++ recipe
For example, for a target which commandline contains
-mfloat-abi=hard -mfpu=fpv4-sp-d16, the precompiled search path will be$libfolder/cortex-m4/fpv4-sp-d16-hardIf that folder doesn't exist the library will be compiled from sources
Open questions:
While reviewing this I found a code path just to add static libraries with non standard name (not starting with "lib" ). Should we keep it or not?@cmaglie
I don't like the name of the subfolder but it's super precise. We should be able to get away with
-float-abi=xxxonly but I'm not 100% sure. Experts' advise are welcome 🙂Fixesarduino/arduino-builder#256