{"comment":{"url":"https://api.github.com/repos/libopencm3/libopencm3/comments/14889005","html_url":"https://github.com/libopencm3/libopencm3/commit/7c1cd2e5cd3f3d1193ee375b46cfd8afaccb89f7#commitcomment-14889005","id":14889005,"user":{"login":"zyp","id":153099,"avatar_url":"https://avatars.githubusercontent.com/u/153099?v=3","gravatar_id":"","url":"https://api.github.com/users/zyp","html_url":"https://github.com/zyp","followers_url":"https://api.github.com/users/zyp/followers","following_url":"https://api.github.com/users/zyp/following{/other_user}","gists_url":"https://api.github.com/users/zyp/gists{/gist_id}","starred_url":"https://api.github.com/users/zyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyp/subscriptions","organizations_url":"https://api.github.com/users/zyp/orgs","repos_url":"https://api.github.com/users/zyp/repos","events_url":"https://api.github.com/users/zyp/events{/privacy}","received_events_url":"https://api.github.com/users/zyp/received_events","type":"User","site_admin":false},"position":18,"line":74,"path":"Makefile","commit_id":"7c1cd2e5cd3f3d1193ee375b46cfd8afaccb89f7","created_at":"2015-12-10T00:32:41Z","updated_at":"2015-12-10T00:32:41Z","body":"> libopencm3 is one of the widely used embedded library and it would be a great example for developers how to do things right.\r\n\r\nWhich is why we should drop `make install`, because that's doing it wrong. Doing it right for a library of this kind is IMO to link it as a git submodule underneath the project itself, which allows the full history of project vs library versioning to be kept.\r\n\r\n> Thus path `/usr/arm-none-eabi/lib/` should be provided by the command line.\r\n\r\nExcept it's the wrong path. Remember that this is a cross compiler targetting multiple sub-architectures, and therefore have a multilib mechanism containing multiple libc (and friends) builds.\r\n\r\nFor cortex-m, you need one of the thumb-only builds. Linking in a libc built for a different sub-architecture tends to work for a while but lead to unexpected crashes when the resulting code tries to change to arm mode which is not present in cortex-m.\r\n\r\nIt's strongly advised to leave the compiler library tree alone and let the multilib mechanism pick the right variant from the supplied compiler flags.\r\n\r\nThe other option would be to actually build multilib variants of libopencm3 itself. The latest gcc-arm-embedded version ships with 10 different ones for cortex-m, which means that you'd need to have 10 copies of libopencm3, built with different options (and for each of these, you'll have multiple builds to support each vendor and chip family that that variant could be appropriate for)."}}