{"action":"created","issue":{"url":"https://api.github.com/repos/modelica/Modelica/issues/2369","repository_url":"https://api.github.com/repos/modelica/Modelica","labels_url":"https://api.github.com/repos/modelica/Modelica/issues/2369/labels{/name}","comments_url":"https://api.github.com/repos/modelica/Modelica/issues/2369/comments","events_url":"https://api.github.com/repos/modelica/Modelica/issues/2369/events","html_url":"https://github.com/modelica/Modelica/pull/2369","id":265724849,"number":2369,"title":"Workaround for dummy usertab function","user":{"login":"sjoelund","id":3016460,"avatar_url":"https://avatars0.githubusercontent.com/u/3016460?v=4","gravatar_id":"","url":"https://api.github.com/users/sjoelund","html_url":"https://github.com/sjoelund","followers_url":"https://api.github.com/users/sjoelund/followers","following_url":"https://api.github.com/users/sjoelund/following{/other_user}","gists_url":"https://api.github.com/users/sjoelund/gists{/gist_id}","starred_url":"https://api.github.com/users/sjoelund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjoelund/subscriptions","organizations_url":"https://api.github.com/users/sjoelund/orgs","repos_url":"https://api.github.com/users/sjoelund/repos","events_url":"https://api.github.com/users/sjoelund/events{/privacy}","received_events_url":"https://api.github.com/users/sjoelund/received_events","type":"User","site_admin":false},"labels":[{"id":517712898,"url":"https://api.github.com/repos/modelica/Modelica/labels/L:%20C-Sources","name":"L: C-Sources","color":"0000aa","default":false}],"state":"open","locked":false,"assignee":{"login":"beutlich","id":14896695,"avatar_url":"https://avatars3.githubusercontent.com/u/14896695?v=4","gravatar_id":"","url":"https://api.github.com/users/beutlich","html_url":"https://github.com/beutlich","followers_url":"https://api.github.com/users/beutlich/followers","following_url":"https://api.github.com/users/beutlich/following{/other_user}","gists_url":"https://api.github.com/users/beutlich/gists{/gist_id}","starred_url":"https://api.github.com/users/beutlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beutlich/subscriptions","organizations_url":"https://api.github.com/users/beutlich/orgs","repos_url":"https://api.github.com/users/beutlich/repos","events_url":"https://api.github.com/users/beutlich/events{/privacy}","received_events_url":"https://api.github.com/users/beutlich/received_events","type":"User","site_admin":false},"assignees":[{"login":"beutlich","id":14896695,"avatar_url":"https://avatars3.githubusercontent.com/u/14896695?v=4","gravatar_id":"","url":"https://api.github.com/users/beutlich","html_url":"https://github.com/beutlich","followers_url":"https://api.github.com/users/beutlich/followers","following_url":"https://api.github.com/users/beutlich/following{/other_user}","gists_url":"https://api.github.com/users/beutlich/gists{/gist_id}","starred_url":"https://api.github.com/users/beutlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beutlich/subscriptions","organizations_url":"https://api.github.com/users/beutlich/orgs","repos_url":"https://api.github.com/users/beutlich/repos","events_url":"https://api.github.com/users/beutlich/events{/privacy}","received_events_url":"https://api.github.com/users/beutlich/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2017-10-16T10:44:03Z","updated_at":"2017-10-16T16:16:25Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/modelica/Modelica/pulls/2369","html_url":"https://github.com/modelica/Modelica/pull/2369","diff_url":"https://github.com/modelica/Modelica/pull/2369.diff","patch_url":"https://github.com/modelica/Modelica/pull/2369.patch"},"body":"This is a workaround for GCC/LLVM optimizing the function call to\r\nusertab which assumes that usertab will not be relocated at runtime.\r\nProviding both a user-defined usertab and the dummy usertab object in\r\nthe same executable is possible on Linux, but confuses the C-compilers.\r\n\r\nThe GCC/autotools projects have been updated, but since VisualStudio\r\ndoes not include the dummy usertab, the new source-file is not included\r\nfor VisualStudio.\r\n\r\nNote: There is a cleaner way to implement handling the usertab function.\r\nBy using dlopen/etc when calling the table constructor, we could query\r\nfor a usertab function at runtime and not need it during compile-time\r\n(making it easier to work with pre-compiled ModelicaStandardTables).\r\nThat would also enable the possibility to have two different usertab\r\nfunctions (passing the name of the function to the constructor) and only\r\nkeep the current (a bit inconvenient) method of Modelica tools needing\r\nto only sometimes provide a dummy usertab function.\r\n\r\n@beutlich without these changes, ModelicaStandardTables only works properly with the `-O0` flag if dummy usertab is provided (getting either illegal pointers or empty strings right after calling usertab). I would much rather have a `dlopen`-based approach sometime in the future."},"comment":{"url":"https://api.github.com/repos/modelica/Modelica/issues/comments/336938473","html_url":"https://github.com/modelica/Modelica/pull/2369#issuecomment-336938473","issue_url":"https://api.github.com/repos/modelica/Modelica/issues/2369","id":336938473,"user":{"login":"sjoelund","id":3016460,"avatar_url":"https://avatars0.githubusercontent.com/u/3016460?v=4","gravatar_id":"","url":"https://api.github.com/users/sjoelund","html_url":"https://github.com/sjoelund","followers_url":"https://api.github.com/users/sjoelund/followers","following_url":"https://api.github.com/users/sjoelund/following{/other_user}","gists_url":"https://api.github.com/users/sjoelund/gists{/gist_id}","starred_url":"https://api.github.com/users/sjoelund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjoelund/subscriptions","organizations_url":"https://api.github.com/users/sjoelund/orgs","repos_url":"https://api.github.com/users/sjoelund/repos","events_url":"https://api.github.com/users/sjoelund/events{/privacy}","received_events_url":"https://api.github.com/users/sjoelund/received_events","type":"User","site_admin":false},"created_at":"2017-10-16T16:16:25Z","updated_at":"2017-10-16T16:16:25Z","author_association":"OWNER","body":"Do you think it would be worth it for me to add a commit using dlopen? I don't want to require special logic in the compiler just for usertab (and especially not workarounds for Visual Studio, MinGW, Linux, BSD, and OSX linkers to deal with duplicate symbols just for this case)."}}
{"actor":{"display_login":"sjoelund"}}