{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10443","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10443/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10443/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10443/events","html_url":"https://github.com/RIOT-OS/RIOT/issues/10443","id":382994065,"node_id":"MDU6SXNzdWUzODI5OTQwNjU=","number":10443,"title":"Unable to find mutex reference: pthread in packages","user":{"login":"Citrullin","id":4502018,"node_id":"MDQ6VXNlcjQ1MDIwMTg=","avatar_url":"https://avatars0.githubusercontent.com/u/4502018?v=4","gravatar_id":"","url":"https://api.github.com/users/Citrullin","html_url":"https://github.com/Citrullin","followers_url":"https://api.github.com/users/Citrullin/followers","following_url":"https://api.github.com/users/Citrullin/following{/other_user}","gists_url":"https://api.github.com/users/Citrullin/gists{/gist_id}","starred_url":"https://api.github.com/users/Citrullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Citrullin/subscriptions","organizations_url":"https://api.github.com/users/Citrullin/orgs","repos_url":"https://api.github.com/users/Citrullin/repos","events_url":"https://api.github.com/users/Citrullin/events{/privacy}","received_events_url":"https://api.github.com/users/Citrullin/received_events","type":"User","site_admin":false},"labels":[{"id":83482730,"node_id":"MDU6TGFiZWw4MzQ4MjczMA==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Area:%20POSIX","name":"Area: POSIX","color":"6600ff","default":false},{"id":23399102,"node_id":"MDU6TGFiZWwyMzM5OTEwMg==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Type:%20question","name":"Type: question","color":"ffff66","default":false}],"state":"open","locked":false,"assignee":{"login":"josephnoir","id":2156518,"node_id":"MDQ6VXNlcjIxNTY1MTg=","avatar_url":"https://avatars3.githubusercontent.com/u/2156518?v=4","gravatar_id":"","url":"https://api.github.com/users/josephnoir","html_url":"https://github.com/josephnoir","followers_url":"https://api.github.com/users/josephnoir/followers","following_url":"https://api.github.com/users/josephnoir/following{/other_user}","gists_url":"https://api.github.com/users/josephnoir/gists{/gist_id}","starred_url":"https://api.github.com/users/josephnoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephnoir/subscriptions","organizations_url":"https://api.github.com/users/josephnoir/orgs","repos_url":"https://api.github.com/users/josephnoir/repos","events_url":"https://api.github.com/users/josephnoir/events{/privacy}","received_events_url":"https://api.github.com/users/josephnoir/received_events","type":"User","site_admin":false},"assignees":[{"login":"josephnoir","id":2156518,"node_id":"MDQ6VXNlcjIxNTY1MTg=","avatar_url":"https://avatars3.githubusercontent.com/u/2156518?v=4","gravatar_id":"","url":"https://api.github.com/users/josephnoir","html_url":"https://github.com/josephnoir","followers_url":"https://api.github.com/users/josephnoir/followers","following_url":"https://api.github.com/users/josephnoir/following{/other_user}","gists_url":"https://api.github.com/users/josephnoir/gists{/gist_id}","starred_url":"https://api.github.com/users/josephnoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephnoir/subscriptions","organizations_url":"https://api.github.com/users/josephnoir/orgs","repos_url":"https://api.github.com/users/josephnoir/repos","events_url":"https://api.github.com/users/josephnoir/events{/privacy}","received_events_url":"https://api.github.com/users/josephnoir/received_events","type":"User","site_admin":false},{"login":"BytesGalore","id":3903215,"node_id":"MDQ6VXNlcjM5MDMyMTU=","avatar_url":"https://avatars3.githubusercontent.com/u/3903215?v=4","gravatar_id":"","url":"https://api.github.com/users/BytesGalore","html_url":"https://github.com/BytesGalore","followers_url":"https://api.github.com/users/BytesGalore/followers","following_url":"https://api.github.com/users/BytesGalore/following{/other_user}","gists_url":"https://api.github.com/users/BytesGalore/gists{/gist_id}","starred_url":"https://api.github.com/users/BytesGalore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BytesGalore/subscriptions","organizations_url":"https://api.github.com/users/BytesGalore/orgs","repos_url":"https://api.github.com/users/BytesGalore/repos","events_url":"https://api.github.com/users/BytesGalore/events{/privacy}","received_events_url":"https://api.github.com/users/BytesGalore/received_events","type":"User","site_admin":false}],"milestone":null,"comments":15,"created_at":"2018-11-21T07:47:01Z","updated_at":"2018-12-01T09:48:54Z","closed_at":null,"author_association":"NONE","body":"I added a [package to RIOT](https://github.com/Citrullin/RIOT/blob/iota_new_implementation/pkg/iota-wallet/Makefile) which clones [this git repo](https://github.com/embedded-iota/micro-light-wallet/tree/micro_wallet).\r\n[I added posix and pthread as depedency](https://github.com/Citrullin/RIOT/blob/iota_new_implementation/pkg/iota-wallet/Makefile.dep).\r\nI also implemented an [example in RIOT](https://github.com/Citrullin/RIOT/tree/iota_new_implementation/examples/iota_transaction_node) to use this package. \r\n\r\nSo, I cd in the example/iota_transaction_node directory and start compiling with make.\r\nThe compiler stops with the following error. Not sure if I did something wrong or if this is a bug.\r\n```\r\nerror: implicit declaration of function 'pthread_mutex_lock'; did you mean 'pthread_atfork'? [-Werror=implicit-function-declaration]\r\n     pthread_mutex_lock(&iota_wallet_bundle_essence_mutex);\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/443414109","html_url":"https://github.com/RIOT-OS/RIOT/issues/10443#issuecomment-443414109","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10443","id":443414109,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzQxNDEwOQ==","user":{"login":"frodak17","id":39267219,"node_id":"MDQ6VXNlcjM5MjY3MjE5","avatar_url":"https://avatars2.githubusercontent.com/u/39267219?v=4","gravatar_id":"","url":"https://api.github.com/users/frodak17","html_url":"https://github.com/frodak17","followers_url":"https://api.github.com/users/frodak17/followers","following_url":"https://api.github.com/users/frodak17/following{/other_user}","gists_url":"https://api.github.com/users/frodak17/gists{/gist_id}","starred_url":"https://api.github.com/users/frodak17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frodak17/subscriptions","organizations_url":"https://api.github.com/users/frodak17/orgs","repos_url":"https://api.github.com/users/frodak17/repos","events_url":"https://api.github.com/users/frodak17/events{/privacy}","received_events_url":"https://api.github.com/users/frodak17/received_events","type":"User","site_admin":false},"created_at":"2018-12-01T09:48:54Z","updated_at":"2018-12-01T09:48:54Z","author_association":"NONE","body":"Hi, I was trying to answer Citrullin's question on [StackOverflow](https://stackoverflow.com/questions/53461598/cmake-for-embedded-remove-linux-posix-headers/).\r\n\r\n@josephnoir @cladmi  I don't think the issue is either with cmake or necessarily with RIOT.  I think the problem is with `arm-none-eabi` and `newlib`.\r\n\r\nAs far as I could tell whenever you include a header file from `newlib` like `stdio.h` it will eventually include `sys/types.h`, `sys/_pthreadtypes.h` and `sys/features.h`.  `sys/_pthreadtypes.h` had a guard and only defined pthread types if `_POSIX_THREADS` was defined.  But this was changed in `newlib` commit `0c081aa62c08c6a00bbacf629e2232dfdd8ba24d` on  Mon Jun 19 2017.  The new guard check is now `#if defined(_POSIX_THREADS) || __POSIX_VISIBLE >= 199506`.  Unfortunately `sys/features.h` will  set `__POSIX_VISIBLE` to 200809 by default.  You can avoid this problem by compiling with strict ANSI mode enabled like using `-std=c99` or `-D__STRICT_ANSI__`. The problem will come back if the source code does anything like `#define _GNU_SOURCE` or anything else that might trigger POSIX mode before including a library header file or trying to use gnu extension `-std=gnu99`.\r\n\r\nAnyways the pkg being developed doesn't pass in the `-std=c99` to `iota-wallet` via `xcompile-toolchain.cmake` correctly.  So when `iota-wallet` compiles `newlib` and RIOT have the pthread compiler error issue.\r\n\r\nThe quickest workaround is to simply update the compiler header files to not use `sys/_pthreadtypes.h` but that isn't really a long term solution. \r\n\r\nI don't know if RIOT has rules stating that strict ANSI is a must because of these kinds of issues."}}
{"actor":{"display_login":"frodak17"}}