{"action":"created","issue":{"url":"https://api.github.com/repos/ckormanyos/real-time-cpp/issues/22","repository_url":"https://api.github.com/repos/ckormanyos/real-time-cpp","labels_url":"https://api.github.com/repos/ckormanyos/real-time-cpp/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/ckormanyos/real-time-cpp/issues/22/comments","events_url":"https://api.github.com/repos/ckormanyos/real-time-cpp/issues/22/events","html_url":"https://github.com/ckormanyos/real-time-cpp/issues/22","id":137055086,"number":22,"title":"Library with avr-ar","user":{"login":"ajneu","id":11367585,"avatar_url":"https://avatars.githubusercontent.com/u/11367585?v=3","gravatar_id":"","url":"https://api.github.com/users/ajneu","html_url":"https://github.com/ajneu","followers_url":"https://api.github.com/users/ajneu/followers","following_url":"https://api.github.com/users/ajneu/following{/other_user}","gists_url":"https://api.github.com/users/ajneu/gists{/gist_id}","starred_url":"https://api.github.com/users/ajneu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajneu/subscriptions","organizations_url":"https://api.github.com/users/ajneu/orgs","repos_url":"https://api.github.com/users/ajneu/repos","events_url":"https://api.github.com/users/ajneu/events{/privacy}","received_events_url":"https://api.github.com/users/ajneu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-02-28T13:51:35Z","updated_at":"2016-07-11T20:46:28Z","closed_at":null,"body":"Hi Christopher,\r\n\r\nactually `mcal` would be great to place into a library archive.\r\nI've given this a try with the code from `chapter02_03`, but think I'm doing something wrong.\r\nWould be nice if someone could give this a try also. (perhaps someone well acquainted with gcc and/or binutils here somewhere??)\r\n\r\nBackground: I actually want to write some nice `CMakeLists.txt`, that then handle this nicely (library creation); but I need to know if I'm doing something wrong (or not?)\r\n.\r\n.\r\n.\r\n\r\nAnyway... I think I'm doing it wrong, since I get a really really small hex (I don't currently have AVR hardware, so I cannot test the hex.)\r\n\r\nHere's what I've tried:\r\n\r\n* **Create `bin/libmcal.a`**\r\n * Create the objects  \r\n `bin/mcal.o` `bin/mcal_gcc_cxx_completion.o` `bin/mcal_cpu.o` `bin/mcal_gpt.o` `bin/mcal_irq.o` `bin/mcal_led.o`\r\n * Combine those objects into an archive `bin/libmcal.a` with this command:  \r\n ```bash\r\navr-ar qc  bin/libmcal.a     bin/mcal.o bin/mcal_gcc_cxx_completion.o bin/mcal_cpu.o bin/mcal_gpt.o bin/mcal_irq.o bin/mcal_led.o\r\n```\r\n * Call ranlib on the archive:\r\n ```bash\r\navr-ranlib  bin/libmcal.a\r\n```\r\n\r\n* **Create `bin/libstartup.a`**\r\n * Create the objects  \r\n `bin/crt0.o` `bin/crt0_init_ram.o` `bin/crt1.o` `bin/int_vect.o`\r\n * Combine those objects into an archive `bin/libstartup.a` with this command:  \r\n ```bash\r\navr-ar qc  bin/libstartup.a     bin/crt0.o bin/crt0_init_ram.o bin/crt1.o bin/int_vect.o\r\n```\r\n * Call ranlib on the archive:\r\n ```bash\r\navr-ranlib  bin/libstartup.a\r\n```\r\n* **Create `bin/sys_start.o` (from `sys_start.cpp`) and link if with `bin/libmcal.a` and `bin/libstartup.a`**\r\n * Create object `bin/sys_start.o`\r\n * Link  \r\n ```bash\r\navr-g++ -x none -mrelax -nostartfiles $CFLAGS $CPPFLAGS $CINCLUDES -Wl,--gc-sections -Wl,-Ttarget/micros/avr/make/avr.ld,-Map,bin/chapter02_03.map bin/sys_start.o  -o bin/chapter02_03.elf   bin/libmcal.a bin/libstartup.a\r\n```"},"comment":{"url":"https://api.github.com/repos/ckormanyos/real-time-cpp/issues/comments/231859551","html_url":"https://github.com/ckormanyos/real-time-cpp/issues/22#issuecomment-231859551","issue_url":"https://api.github.com/repos/ckormanyos/real-time-cpp/issues/22","id":231859551,"user":{"login":"ckormanyos","id":2404721,"avatar_url":"https://avatars.githubusercontent.com/u/2404721?v=3","gravatar_id":"","url":"https://api.github.com/users/ckormanyos","html_url":"https://github.com/ckormanyos","followers_url":"https://api.github.com/users/ckormanyos/followers","following_url":"https://api.github.com/users/ckormanyos/following{/other_user}","gists_url":"https://api.github.com/users/ckormanyos/gists{/gist_id}","starred_url":"https://api.github.com/users/ckormanyos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckormanyos/subscriptions","organizations_url":"https://api.github.com/users/ckormanyos/orgs","repos_url":"https://api.github.com/users/ckormanyos/repos","events_url":"https://api.github.com/users/ckormanyos/events{/privacy}","received_events_url":"https://api.github.com/users/ckormanyos/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T20:46:28Z","updated_at":"2016-07-11T20:46:28Z","body":"I will try to look into this.\r\n\r\nBest regards, Chris"}}
{"actor":{"display_login":"ckormanyos"}}