+
+
Test Summary
+
+
+
+ Start time/End Time:
+ {{summary_data._start_time}} - {{summary_data._end_time}}
+
+
+
+
+ Execution Time:
+ {{summary_data._execution_time}}
+
+
+
+
+
+ {{summary_data._file_size_sum}}
+
+ Total Size
+
+
+
+
+
+
+
+
+ {% for check_item in check_items %}
+
+
+
+ {% if check_item._do_check == "true" %}
+
+
+
+
+
+
+
+ No
+ Failed Files
+ Expected
+ Actual
+ Results
+
+
+
+ {% for failed_file in check_item._failed_list %}
+
+ {{loop.index}}
+ {{failed_file}}
+ {{check_item._check_flag}}
+ {% for found_file in total_file_info %}
+ {% if found_file.filename == failed_file %}
+ {% if check_item._name == "relro" and found_file.relro != check_item._check_flag%}
+ {{found_file.relro}}
+ {% elif check_item._name == "canary" and found_file.canary != check_item._check_flag %}
+ {{found_file.canary}}
+ {% elif check_item._name == "nx" and found_file.nx != check_item._check_flag %}
+ {{found_file.nx}}
+ {% elif check_item._name == "pie" and found_file.pie != check_item._check_flag %}
+ {{found_file.pie}}
+ {% elif check_item._name == "rpath" and found_file.rpath != check_item._check_flag %}
+ {{found_file.rpath}}
+ {% elif check_item._name == "fortify" and found_file.fortify_source != check_item._check_flag %}
+ {{found_file.fortify_source}}
+ {% elif check_item._name == "symbols" and found_file.symbols != check_item._check_flag %}
+ {{found_file.symbols}}
+ {% elif check_item._name == "clangcfi" and found_file.clangcfi != check_item._check_flag %}
+ {{found_file.clangcfi}}
+ {% elif check_item._name == "safestack" and found_file.safestack != check_item._check_flag %}
+ {{found_file.safestack}}
+ {% elif check_item._name == "fortified" and found_file.fortified != check_item._check_flag %}
+ {{found_file.fortified}}
+ {% elif check_item._name == "fortify-able" and found_file.fortify_able != check_item._check_flag %}
+ {{found_file.fortify_able}}
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ Failed
+
+ {% endfor %}
+
+
+
+
+
+
+
+
+
+
+
+
+ No
+ Passed Files
+ Expected
+ Actual
+ Results
+
+
+
+ {% for pass_file in check_item._passed_list %}
+
+ {{loop.index}}
+ {{pass_file}}
+ {{check_item._check_flag}}
+ {% for found_file in total_file_info %}
+ {% if found_file.filename == pass_file %}
+ {% if check_item._name == "relro" and found_file.relro == check_item._check_flag%}
+ {{found_file.relro}}
+ {% elif check_item._name == "canary" and found_file.canary == check_item._check_flag %}
+ {{found_file.canary}}
+ {% elif check_item._name == "nx" and found_file.nx == check_item._check_flag %}
+ {{found_file.nx}}
+ {% elif check_item._name == "pie" and found_file.pie == check_item._check_flag %}
+ {{found_file.pie}}
+ {% elif check_item._name == "rpath" and found_file.rpath == check_item._check_flag %}
+ {{found_file.rpath}}
+ {% elif check_item._name == "fortify" and found_file.fortify_source == check_item._check_flag %}
+ {{found_file.fortify_source}}
+ {% elif check_item._name == "symbols" and found_file.symbols == check_item._check_flag %}
+ {{found_file.symbols}}
+ {% elif check_item._name == "clangcfi" and found_file.clangcfi == check_item._check_flag %}
+ {{found_file.clangcfi}}
+ {% elif check_item._name == "safestack" and found_file.safestack == check_item._check_flag %}
+ {{found_file.safestack}}
+ {% elif check_item._name == "fortified" and found_file.fortified == check_item._check_flag %}
+ {{found_file.fortified}}
+ {% elif check_item._name == "fortify-able" and found_file.fortify_able == check_item._check_flag %}
+ {{found_file.fortify_able}}
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ Passed
+
+ {% endfor %}
+
+
+
+
+
+ {% else %}
+
+
+
+
+
+ No
+ Passed Files
+ Actual
+
+
+
+ {% for pass_file in check_item._passed_list %}
+
+ {{loop.index}}
+ {{pass_file}}
+ {% for found_file in total_file_info %}
+ {% if found_file.filename == pass_file %}
+ {% if check_item.name == "relro" %}
+ {{found_file.relro}}
+ {% elif check_item._name == "canary" %}
+ {{found_file.canary}}
+ {% elif check_item._name == "nx" %}
+ {{found_file.nx}}
+ {% elif check_item._name == "pie" %}
+ {{found_file.pie}}
+ {% elif check_item._name == "rpath" %}
+ {{found_file.rpath}}
+ {% elif check_item._name == "fortify" %}
+ {{found_file.fortify_source}}
+ {% elif check_item._name == "symbols" %}
+ {{found_file.symbols}}
+ {% elif check_item._name == "clangcfi" %}
+ {{found_file.clangcfi}}
+ {% elif check_item._name == "safestack" %}
+ {{found_file.safestack}}
+ {% elif check_item._name == "fortified" %}
+ {{found_file.fortified}}
+ {% elif check_item._name == "fortify-able" %}
+ {{found_file.fortify_able}}
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+
+ {% endfor %}
+
+
+
+
+ {% endif %}
+ {% endfor %}
+
+
+
+
+
\ No newline at end of file
diff --git a/llvm-build/checksec/templates/jquery.min.js b/llvm-build/checksec/templates/jquery.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..0de648ed3b5201e4e05ace86e01f8ef201d2770e
--- /dev/null
+++ b/llvm-build/checksec/templates/jquery.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.6.4 | (c) OpenJS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.4",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0
+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssHas=ce(function(){try{return C.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML=" ",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML=" ";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML=" ",v.option=!!ce.lastChild;var ge={thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% for found_file in total_file_info %}
+
+
+
+
+
+
+ relro
+ canary
+ nx
+ pie
+ clangcfi
+ safestack
+ rpath
+ symbols
+ fortify
+ fortified
+ fortify-able
+ file size
+
+
+
+
+ {{found_file.relro}}
+ {{found_file.canary}}
+ {{found_file.nx}}
+ {{found_file.pie}}
+ {{found_file.clangcfi}}
+ {{found_file.safestack}}
+ {{found_file.rpath}}
+ {{found_file.symbols}}
+ {{found_file.fortify_source}}
+ {{found_file.fortified}}
+ {{found_file.fortify_able}}
+ {{found_file.file_single_size}}
+
+
+
+
+
+ {% endfor %}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/llvm-build/cross_toolchain_builder.py b/llvm-build/cross_toolchain_builder.py
index 81f167f617eb295f51e24658d0e9c42adefa3691..7f2bb792fa7815e9bd22292ceb7e7e22f9719adc 100644
--- a/llvm-build/cross_toolchain_builder.py
+++ b/llvm-build/cross_toolchain_builder.py
@@ -177,6 +177,16 @@ class CrossToolchainBuilder:
)
)
+ if self._build_config.enable_lzma_7zip:
+ lldb_defines['LLDB_ENABLE_LZMA'] = 'ON'
+ lldb_defines['LLDB_ENABLE_LZMA_7ZIP'] = 'ON'
+ lldb_defines['LIBLZMA_INCLUDE_DIRS'] = (
+ self._build_utils.merge_install_dir('lzma', self._llvm_triple, 'include')
+ )
+ lldb_defines['LIBLZMA_LIBRARIES'] = (
+ self._build_utils.merge_install_dir('lzma', self._llvm_triple, 'lib', 'liblzma.so')
+ )
+
if self._build_config.build_python or self._install_python_from_prebuilts:
lldb_defines["LLDB_ENABLE_PYTHON"] = "ON"
lldb_defines["LLDB_EMBED_PYTHON_HOME"] = "ON"
@@ -199,7 +209,6 @@ class CrossToolchainBuilder:
)
lldb_defines['Python3_RPATH'] = os.path.join('$ORIGIN', '..', 'python3', 'lib')
- lldb_defines["LLDB_ENABLE_LZMA"] = "OFF"
# Debug & Tuning
if self._build_config.enable_monitoring:
lldb_defines["LLDB_ENABLE_PERFORMANCE"] = "ON"
@@ -216,6 +225,8 @@ class CrossToolchainBuilder:
if self._build_config.build_python:
self._python_builder.build()
self._python_builder.prepare_for_package()
+ if self._build_config.enable_lzma_7zip:
+ self._llvm_libs.build_lzma(self._llvm_path, self._llvm_install, self._llvm_triple)
self._build_utils.invoke_cmake(
self._llvm_project_path,
diff --git a/llvm-build/platform_package.sh b/llvm-build/platform_package.sh
new file mode 100644
index 0000000000000000000000000000000000000000..e5cff03aff7a13179d2a23e64818dc2edd21756e
--- /dev/null
+++ b/llvm-build/platform_package.sh
@@ -0,0 +1,147 @@
+#!/bin/bash
+# Copyright (c) 2024 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# init variable
+commit_id=""
+date=""
+
+clang_linux_x86_64_tar="clang-dev-linux-x86_64.tar.gz"
+clang_darwin_arm64_tar="clang-dev-darwin-arm64.tar.gz"
+clang_darwin_x86_64_tar="clang-dev-darwin-x86_64.tar.gz"
+clang_windows_x86_64_tar="clang-dev-windows-x86_64.tar.gz"
+clang_ohos_arm64_tar="clang-dev-ohos-aarch64.tar.gz"
+clang_linux_aarch64_tar="clang-dev-linux-aarch64.tar.gz"
+libcxx_ndk_linux_x86_64_tar="libcxx-ndk-dev-linux-x86_64.tar.gz"
+libcxx_ndk_darwin_x86_64_tar="libcxx-ndk-dev-darwin-x86_64.tar.gz"
+libcxx_ndk_darwin_arm64_tar="libcxx-ndk-dev-darwin-arm64.tar.gz"
+libcxx_ndk_windows_x86_64_tar="libcxx-ndk-dev-windows-x86_64.tar.gz"
+libcxx_ndk_linux_aarch64_tar="libcxx-ndk-dev-linux-aarch64.tar.gz"
+
+clang_linux_x86_64="clang_linux-x86_64-${commit_id}-${date}"
+clang_darwin_arm64="clang_darwin-arm64-${commit_id}-${date}"
+clang_darwin_x86_64="clang_darwin-x86_64-${commit_id}-${date}"
+clang_windows_x86_64="clang_windows-x86_64-${commit_id}-${date}"
+clang_ohos_arm64="clang_ohos-arm64-${commit_id}-${date}"
+clang_linux_aarch64="clang_linux_aarch64-${commit_id}-${date}"
+libcxx_ndk_linux_x86_64="libcxx-ndk_linux-x86_64-${commit_id}-${date}"
+libcxx_ndk_darwin_x86_64="libcxx-ndk_darwin-x86_64-${commit_id}-${date}"
+libcxx_ndk_darwin_arm64="libcxx-ndk_darwin-arm64-${commit_id}-${date}"
+libcxx_ndk_windows_x86_64="libcxx-ndk_windows-x86_64-${commit_id}-${date}"
+libcxx_ndk_ohos_arm64="libcxx_ndk_ohos-arm64-${commit_id}-${date}"
+libcxx_ndk_linux_aarch64="libcxx-ndk_linux-aarch64-${commit_id}-${date}"
+llvm_list=($clang_linux_x86_64 $clang_darwin_arm64 $clang_darwin_x86_64 $clang_windows_x86_64 $clang_ohos_arm64 $clang_linux_aarch64 $libcxx_ndk_linux_x86_64 $libcxx_ndk_darwin_x86_64 $libcxx_ndk_darwin_arm64 $libcxx_ndk_windows_x86_64 $libcxx_ndk_ohos_arm64 $libcxx_ndk_linux_aarch64)
+
+# decompress file and rename
+tar -xvf ${clang_linux_x86_64_tar}
+mv clang-dev ${clang_linux_x86_64}
+tar -xvf ${clang_darwin_arm64_tar}
+mv clang-dev ${clang_darwin_arm64}
+tar -xvf ${clang_darwin_x86_64_tar}
+mv clang-dev ${clang_darwin_x86_64}
+tar -xvf ${clang_windows_x86_64_tar}
+mv clang-dev ${clang_windows_x86_64}
+tar -xvf ${clang_ohos_arm64_tar}
+mv clang-dev ${clang_ohos_arm64}
+tar -xvf ${clang_linux_aarch64_tar}
+mv clang-dev ${clang_linux_aarch64}
+tar -xvf ${libcxx_ndk_linux_x86_64_tar}
+mv libcxx-ndk ${libcxx_ndk_linux_x86_64}
+tar -xvf ${libcxx_ndk_darwin_x86_64_tar}
+mv libcxx-ndk ${libcxx_ndk_darwin_x86_64}
+tar -xvf ${libcxx_ndk_darwin_arm64_tar}
+mv libcxx-ndk ${libcxx_ndk_darwin_arm64}
+tar -xvf ${libcxx_ndk_windows_x86_64_tar}
+mv libcxx-ndk ${libcxx_ndk_windows_x86_64}
+cp -ar ${libcxx_ndk_linux_x86_64} ${libcxx_ndk_ohos_arm64}
+tar -xvf ${libcxx_ndk_linux_aarch64_tar}
+mv libcxx-ndk ${libcxx_ndk_linux_aarch64}
+
+#clang-dev-darwin-arm64
+cp -rf ${clang_linux_x86_64}/lib/aarch64-linux-ohos ${clang_darwin_arm64}/lib
+cp -rf ${clang_linux_x86_64}/lib/arm-liteos-ohos ${clang_darwin_arm64}/lib
+cp -rf ${clang_linux_x86_64}/include/libcxx-ohos ${clang_darwin_arm64}/include
+cp -rf ${clang_linux_x86_64}/lib/arm-linux-ohos ${clang_darwin_arm64}/lib
+cp -rf ${clang_linux_x86_64}/lib/loongarch64-linux-ohos ${clang_darwin_arm64}/lib
+cp -rf ${clang_linux_x86_64}/lib/x86_64-linux-ohos ${clang_darwin_arm64}/lib
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/bin ${clang_darwin_arm64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/profile ${clang_darwin_arm64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/fuzzer ${clang_darwin_arm64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/share ${clang_darwin_arm64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/sanitizer ${clang_darwin_arm64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/lib/ ${clang_darwin_arm64}/lib/clang/15.0.4
+
+#clang-dev-darwin-x86_64
+cp -rf ${clang_linux_x86_64}/lib/aarch64-linux-ohos ${clang_darwin_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/arm-liteos-ohos ${clang_darwin_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/arm-linux-ohos ${clang_darwin_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/x86_64-linux-ohos ${clang_darwin_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/loongarch64-linux-ohos ${clang_darwin_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/bin ${clang_darwin_x86_64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/share ${clang_darwin_x86_64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/lib ${clang_darwin_x86_64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/profile ${clang_darwin_x86_64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/fuzzer ${clang_darwin_x86_64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/sanitizer ${clang_darwin_x86_64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/include/libcxx-ohos ${clang_darwin_x86_64}/include
+
+#clang-dev-windows-x86_64
+cp -rf ${clang_linux_x86_64}/include/libcxx-ohos ${clang_windows_x86_64}/include
+cp -rf ${clang_linux_x86_64}/lib/aarch64-linux-ohos ${clang_windows_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/arm-liteos-ohos ${clang_windows_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/arm-linux-ohos ${clang_windows_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/x86_64-linux-ohos ${clang_windows_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/loongarch64-linux-ohos ${clang_windows_x86_64}/lib
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/bin ${clang_windows_x86_64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/share ${clang_windows_x86_64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/lib ${clang_windows_x86_64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/profile ${clang_windows_x86_64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/fuzzer ${clang_windows_x86_64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/sanitizer ${clang_windows_x86_64}/lib/clang/15.0.4/include
+
+
+#clang-dev-ohos-aarch64
+cp -rf ${clang_linux_x86_64}/include/libcxx-ohos ${clang_ohos_arm64}/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/bin ${clang_ohos_arm64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/share ${clang_ohos_arm64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/lib ${clang_ohos_arm64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/profile ${clang_ohos_arm64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/fuzzer ${clang_ohos_arm64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/sanitizer ${clang_ohos_arm64}/lib/clang/15.0.4/include
+
+#clang-dev-linux-aarch64
+cp -rf ${clang_linux_x86_64}/include/libcxx-ohos ${clang_linux_aarch64}/include
+cp -rf ${clang_linux_x86_64}/lib/aarch64-linux-ohos ${clang_linux_aarch64}/lib
+cp -rf ${clang_linux_x86_64}/lib/arm-liteos-ohos ${clang_linux_aarch64}/lib
+cp -rf ${clang_linux_x86_64}/lib/arm-linux-ohos ${clang_linux_aarch64}/lib
+cp -rf ${clang_linux_x86_64}/lib/x86_64-linux-ohos ${clang_linux_aarch64}/lib
+cp -rf ${clang_linux_x86_64}/lib/loongarch64-linux-ohos ${clang_linux_aarch64}/lib
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/bin ${clang_linux_aarch64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/share ${clang_linux_aarch64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/lib ${clang_linux_aarch64}/lib/clang/15.0.4
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/profile ${clang_linux_aarch64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/fuzzer ${clang_linux_aarch64}/lib/clang/15.0.4/include
+cp -rf ${clang_linux_x86_64}/lib/clang/15.0.4/include/sanitizer ${clang_linux_aarch64}/lib/clang/15.0.4/include
+
+
+#archive
+mkdir target_location
+function package_llvm(){
+for i in ${llvm_list[@]}
+do
+ tar zcvf target_location/${i}.tar.gz ${i}
+ sha256sum target_location/${i}.tar.gz |awk '{print $1}' > target_location/${i}.tar.gz.sha256
+done
+}
+
+package_llvm
diff --git a/llvm/include/llvm/PARTS/Parts.h b/llvm/include/llvm/PARTS/Parts.h
index 4c23975f134350c455f4d92abdb7ceb7f119c55f..ad62b5c6358d9ba40afcf35ce44afd023625655c 100644
--- a/llvm/include/llvm/PARTS/Parts.h
+++ b/llvm/include/llvm/PARTS/Parts.h
@@ -38,6 +38,7 @@ bool useDataFieldTag();
bool useDataFieldProtection();
PartsBeCfiType getBeCfiType();
uint16_t getTypeIdFor(const Type *T);
+std::string getLLVMRevision();
}
}
#endif
\ No newline at end of file
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h
index 033482977a105cae0af9466a0d42756aec9b1116..55783ac776f9d979dedd897ca782e02771fb26db 100644
--- a/llvm/include/llvm/Support/FileSystem.h
+++ b/llvm/include/llvm/Support/FileSystem.h
@@ -1451,6 +1451,12 @@ public:
return *this;
}
+ // OHOS_LOCAL begin
+ intptr_t get_handler() {
+ return State->IterationHandle;
+ }
+ // OHOS_LOCAL end
+
const directory_entry &operator*() const { return State->CurrentEntry; }
const directory_entry *operator->() const { return &State->CurrentEntry; }
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 54af144299077b0fecc36c893a78809d0d86a385..9945b795dc4dd79f91f7fae24c1d8d75b9f62776 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1071,6 +1071,13 @@ DwarfDebug::getOrCreateDwarfCompileUnit(const DICompileUnit *DIUnit) {
if (auto *CU = CUMap.lookup(DIUnit))
return *CU;
+ if (useSplitDwarf() &&
+ !shareAcrossDWOCUs() &&
+ (!DIUnit->getSplitDebugInlining() ||
+ DIUnit->getEmissionKind() == DICompileUnit::FullDebug) &&
+ !CUMap.empty()) {
+ return *CUMap.begin()->second;
+ }
CompilationDir = DIUnit->getDirectory();
auto OwnedUnit = std::make_unique(
@@ -1274,6 +1281,8 @@ void DwarfDebug::finalizeModuleInfo() {
if (CUMap.size() > 1)
DWOName = Asm->TM.Options.MCOptions.SplitDwarfFile;
+ bool HasEmittedSplitCU = false;
+
// Handle anything that needs to be done on a per-unit basis after
// all other generation.
for (const auto &P : CUMap) {
@@ -1292,6 +1301,10 @@ void DwarfDebug::finalizeModuleInfo() {
bool HasSplitUnit = SkCU && !TheCU.getUnitDie().children().empty();
if (HasSplitUnit) {
+ (void)HasEmittedSplitCU;
+ assert((shareAcrossDWOCUs() || !HasEmittedSplitCU) &&
+ "Multiple CUs emitted into a single dwo file");
+ HasEmittedSplitCU = true;
dwarf::Attribute attrDWOName = getDwarfVersion() >= 5
? dwarf::DW_AT_dwo_name
: dwarf::DW_AT_GNU_dwo_name;
@@ -2203,7 +2216,7 @@ void DwarfDebug::endFunctionImpl(const MachineFunction *MF) {
LexicalScope *FnScope = LScopes.getCurrentFunctionScope();
assert(!FnScope || SP == FnScope->getScopeNode());
- DwarfCompileUnit &TheCU = *CUMap.lookup(SP->getUnit());
+ DwarfCompileUnit &TheCU = getOrCreateDwarfCompileUnit(SP->getUnit());
if (TheCU.getCUNode()->isDebugDirectivesOnly()) {
PrevLabel = nullptr;
CurFn = nullptr;
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index 81238b0fe0d2872f013f691cdb362143a9431f66..151bf376e0c5ec3b364e019a79a5a610dc477f88 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -544,7 +544,7 @@ void DwarfUnit::addAccess(DIE &Die, DINode::DIFlags Flags) {
}
DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) {
- if (!Context || isa(Context))
+ if (!Context || isa(Context) || isa(Context))
return &getUnitDie();
if (auto *T = dyn_cast(Context))
return getOrCreateTypeDIE(T);
diff --git a/llvm/lib/PARTS/Parts.cpp b/llvm/lib/PARTS/Parts.cpp
index a49b889829a688664d2a74c88d4898a355b8466f..a013a62a926113304d2d4da3a38acda84e253505 100644
--- a/llvm/lib/PARTS/Parts.cpp
+++ b/llvm/lib/PARTS/Parts.cpp
@@ -136,4 +136,13 @@ uint16_t llvm::PARTS::getTypeIdFor(const Type *T)
uint16_t TheTypeId = getTypeId(Buf);
TypeIdCache.emplace(T, TheTypeId);
return TheTypeId;
+}
+
+std::string llvm::PARTS::getLLVMRevision()
+{
+#ifdef LLVM_REVISION
+ return LLVM_REVISION;
+#else
+ return "";
+#endif
}
\ No newline at end of file
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 27c04177e894d141b0ff5456229391d687de129e..cbb96e657f0b694ab28dbaf4c8d35236474b8f10 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -673,6 +673,12 @@ bool TailRecursionEliminator::eliminateCall(CallInst *CI) {
for (unsigned I = 0, E = CI->arg_size(); I != E; ++I) {
if (CI->isByValArgument(I)) {
copyLocalTempOfByValueOperandIntoArguments(CI, I);
+ // When eliminating a tail call, we modify the values of the arguments.
+ // Therefore, if the byval parameter has a readonly attribute, we have to
+ // remove it. It is safe because, from the perspective of a caller, the
+ // byval parameter is always treated as "readonly," even if the readonly
+ // attribute is removed.
+ F.removeParamAttr(I, Attribute::ReadOnly);
ArgumentPHIs[I]->addIncoming(F.getArg(I), BB);
} else
ArgumentPHIs[I]->addIncoming(CI->getArgOperand(I), BB);
diff --git a/llvm/test/DebugInfo/X86/split-dwarf-cross-cu-gmlt-g.ll b/llvm/test/DebugInfo/X86/split-dwarf-cross-cu-gmlt-g.ll
index ac5a10652ba92792c708c08994474b2bc011ea89..03a444976e3e9e0427210be0cf2bc40239c16a6f 100644
--- a/llvm/test/DebugInfo/X86/split-dwarf-cross-cu-gmlt-g.ll
+++ b/llvm/test/DebugInfo/X86/split-dwarf-cross-cu-gmlt-g.ll
@@ -8,10 +8,12 @@
; CHECK-NEXT: DW_AT_decl_file (0x02)
; CHECK-NEXT: DW_AT_decl_line (4)
-; Function Attrs: noinline nounwind optnone uwtable mustprogress
-define dso_local void @_Z2f1v() local_unnamed_addr #0 !dbg !12 {
+; Function Attrs: norecurse nounwind uwtable mustprogress
+define dso_local i32 @main() local_unnamed_addr #2 !dbg !26 {
entry:
- ret void, !dbg !15
+ tail call void @_Z2f1v() #3, !dbg !28
+ tail call void @_Z2f1v() #3, !dbg !30
+ ret i32 0, !dbg !32
}
; Function Attrs: nounwind uwtable mustprogress
@@ -21,6 +23,12 @@ entry:
ret void, !dbg !22
}
+; Function Attrs: noinline nounwind optnone uwtable mustprogress
+define dso_local void @_Z2f1v() local_unnamed_addr #0 !dbg !12 {
+entry:
+ ret void, !dbg !15
+}
+
; Function Attrs: nounwind uwtable mustprogress
define dso_local void @_Z2f2v() local_unnamed_addr #1 !dbg !23 {
entry:
@@ -28,14 +36,6 @@ entry:
ret void, !dbg !25
}
-; Function Attrs: norecurse nounwind uwtable mustprogress
-define dso_local i32 @main() local_unnamed_addr #2 !dbg !26 {
-entry:
- tail call void @_Z2f1v() #3, !dbg !28
- tail call void @_Z2f1v() #3, !dbg !30
- ret i32 0, !dbg !32
-}
-
attributes #0 = { noinline nounwind optnone uwtable mustprogress "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable mustprogress "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { norecurse nounwind uwtable mustprogress "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
diff --git a/llvm/test/DebugInfo/X86/split-dwarf-cross-unit-reference.ll b/llvm/test/DebugInfo/X86/split-dwarf-cross-unit-reference.ll
index 7b73abacdf5566ac2e2ade889a3de17b62c8acfd..4cc232c970ed4159391a704af8f72749d4c44cfa 100644
--- a/llvm/test/DebugInfo/X86/split-dwarf-cross-unit-reference.ll
+++ b/llvm/test/DebugInfo/X86/split-dwarf-cross-unit-reference.ll
@@ -1,12 +1,12 @@
; RUN: llc -mtriple=x86_64-linux -split-dwarf-cross-cu-references -split-dwarf-file=foo.dwo -filetype=obj -o %t < %s
-; RUN: llvm-objdump -r %t | FileCheck %s
-; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck --check-prefix=ALL --check-prefix=INFO --check-prefix=DWO --check-prefix=CROSS %s
-; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck --check-prefix=ALL --check-prefix=INFO %s
+; RUN: llvm-objdump -r %t | FileCheck --check-prefix=CHECK --check-prefix=RELO_CROSS %s
+; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck --check-prefix=ALL --check-prefix=DWO --check-prefix=CROSS %s
+; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck --check-prefix=ALL %s
; RUN: llc -mtriple=x86_64-linux -split-dwarf-file=foo.dwo -filetype=obj -o %t < %s
-; RUN: llvm-objdump -r %t | FileCheck %s
+; RUN: llvm-objdump -r %t | FileCheck --check-prefix=CHECK %s
; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck --check-prefix=ALL --check-prefix=DWO --check-prefix=NOCROSS %s
-; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck --check-prefix=ALL --check-prefix=INFO %s
+; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck --check-prefix=ALL %s
; Testing cross-CU references for types, subprograms, and variables
; Built from code something like this:
@@ -48,8 +48,8 @@
; CHECK-NOT: RELOCATION RECORDS
; Expect one relocation in debug_info, from the inlined f1 in foo to its
; abstract origin in bar
-; CHECK: R_X86_64_32 .debug_info
-; CHECK-NOT: RELOCATION RECORDS
+; RELO_CROSS: R_X86_64_32 .debug_info
+; Expect no relocations in debug_info when disabling multiple CUs in Split DWARF
; CHECK-NOT: .debug_info
; CHECK: RELOCATION RECORDS
; CHECK-NOT: .rel{{a?}}.debug_info.dwo
@@ -75,29 +75,22 @@
; DWO: DW_TAG_formal_parameter
; DWO: DW_AT_abstract_origin [DW_FORM_ref4] {{.*}}{0x[[F1T]]}
-; ALL: Compile Unit
-; ALL: DW_TAG_compile_unit
-; DWO: DW_AT_name {{.*}} "bar.cpp"
-; NOCROSS: 0x[[BAR_F1:.*]]: DW_TAG_subprogram
-; NOCROSS: DW_AT_name {{.*}} "f1"
-; NOCROSS: 0x[[BAR_F1T:.*]]: DW_TAG_formal_parameter
-; NOCROSS: DW_AT_name {{.*}} "t"
-; NOCROSS: DW_AT_type [DW_FORM_ref4] {{.*}}{0x[[BAR_T1:.*]]}
-; NOCROSS: NULL
-; NOCROSS: 0x[[BAR_T1]]: DW_TAG_structure_type
-; NOCROSS: DW_AT_name {{.*}} "t1"
+; NOCROSS-NOT: DW_TAG_compile_unit
+; CROSS: Compile Unit
+; CROSS: DW_TAG_compile_unit
+; CROSS: DW_AT_name {{.*}} "bar.cpp"
; ALL: DW_TAG_subprogram
; ALL: DW_AT_name {{.*}} "bar"
; DWO: DW_TAG_formal_parameter
; DWO: DW_AT_name {{.*}} "t"
; CROSS: DW_AT_type [DW_FORM_ref_addr] (0x00000000[[T1]]
-; NOCROSS: DW_AT_type [DW_FORM_ref4] {{.*}}{0x[[BAR_T1]]}
+; NOCROSS: DW_AT_type [DW_FORM_ref4] {{.*}}{0x[[T1]]}
; ALL: DW_TAG_inlined_subroutine
-; INFO: DW_AT_abstract_origin [DW_FORM_ref_addr] (0x00000000[[F1]]
-; NOCROSS: DW_AT_abstract_origin [DW_FORM_ref4] {{.*}}{0x[[BAR_F1]]}
+; CROSS: DW_AT_abstract_origin [DW_FORM_ref_addr] (0x00000000[[F1]]
+; NOCROSS: DW_AT_abstract_origin [DW_FORM_ref4] {{.*}}{0x[[F1]]}
; DWO: DW_TAG_formal_parameter
; CROSS: DW_AT_abstract_origin [DW_FORM_ref_addr] (0x00000000[[F1T]]
-; NOCROSS: DW_AT_abstract_origin [DW_FORM_ref4] {{.*}}{0x[[BAR_F1T]]
+; NOCROSS: DW_AT_abstract_origin [DW_FORM_ref4] {{.*}}{0x[[F1T]]
%struct.t1 = type { i32 }
diff --git a/llvm/test/DebugInfo/X86/string-offsets-table-order.ll b/llvm/test/DebugInfo/X86/string-offsets-table-order.ll
index ca159eea615f68465f5d8e6d5b3036ac1bab1010..6a61c458dec3e4a0cfa5ca95bba6bc369d76270b 100644
--- a/llvm/test/DebugInfo/X86/string-offsets-table-order.ll
+++ b/llvm/test/DebugInfo/X86/string-offsets-table-order.ll
@@ -11,13 +11,10 @@
; in different order.
; CHECK: .debug_info contents:
-; CHECK: DW_TAG_skeleton_unit
-; CHECK: DW_AT_comp_dir [DW_FORM_strx1] (indexed (00000000) string = "X3")
-; CHECK: DW_TAG_skeleton_unit
-; CHECK: DW_AT_comp_dir [DW_FORM_strx1] (indexed (00000001) string = "X2")
-; CHECK: DW_TAG_skeleton_unit
-; CHECK: DW_AT_comp_dir [DW_FORM_strx1] (indexed (00000002) string = "X1")
-; CHECK: .debug_info.dwo contents:
+; CHECK: DW_TAG_compile_unit
+; CHECK: DW_AT_name [DW_FORM_strx1] (indexed (00000000) string = "X1")
+; CHECK: DW_AT_name [DW_FORM_strx1] (indexed (00000002) string = "X2")
+; CHECK: DW_AT_name [DW_FORM_strx1] (indexed (00000003) string = "X3")
; CHECK: .debug_str contents:
; CHECK: 0x[[X3:[0-9a-f]*]]: "X3"
@@ -26,11 +23,9 @@
; CHECK: .debug_str_offsets contents:
; CHECK: Format = DWARF32, Version = 5
-; CHECK-NEXT: [[X3]] "X3"
-; CHECK-NEXT: [[X2]] "X2"
-; CHECK-NEXT: [[X1]] "X1"
-; CHECK-NEXT: "foo.dwo"
-; CHECK-EMPTY:
+; CHECK: [[X3]] "X3"
+; CHECK: [[X1]] "X1"
+; CHECK: [[X2]] "X2"
diff --git a/llvm/test/Transforms/PhaseOrdering/pr64289-tce-adapt.ll b/llvm/test/Transforms/PhaseOrdering/pr64289-tce-adapt.ll
new file mode 100644
index 0000000000000000000000000000000000000000..e23e0be79ac1f8c19b8ffbee246731e6ada1872c
--- /dev/null
+++ b/llvm/test/Transforms/PhaseOrdering/pr64289-tce-adapt.ll
@@ -0,0 +1,28 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -O3 < %s | FileCheck %s
+
+; A miscompilation found on https://github.com/llvm/llvm-project/issues/64289.
+; 1. PostOrderFunctionAttrsPass added readonly to the parameter.
+; 2. TailCallElimPass modified the parameter but kept readonly.
+; 3. LICMPass incorrectly hoisted the load instruction.
+
+define void @pr64289(ptr noalias byval(i64) %x) {
+; CHECK-LABEL: @pr64289(
+; CHECK-NOT: readonly
+; CHECK-SAME: byval
+; CHECK-NEXT: start:
+;
+start:
+ %new_x = alloca i64, align 8
+ %x_val = load i64, ptr %x, align 8
+ %is_zero = icmp eq i64 %x_val, 0
+ br i1 %is_zero, label %end, label %recurse
+
+recurse:
+ store i64 0, ptr %new_x, align 8
+ call void @pr64289(ptr %new_x)
+ br label %end
+
+end:
+ ret void
+}
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 0242e0b75af33f7d24b8827ef49c11595f806667..4eceea37a05d1fdfb3e7bf290a81aedbfa9bac62 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -1734,7 +1734,11 @@ def executeShTest(test, litConfig, useExternalSh,
if litConfig.noExecute:
return lit.Test.Result(Test.PASS)
-
+ # OHOS_LOCAL begin
+ # Setting environment variables on a remote device, this command is used only for OpenMP test.
+ if (test.config.name == 'libomp' or test.config.name == 'OMPT multiplex') and test.config.operating_system == 'OHOS':
+ script = replaceEnvrunForScript(script)
+ # OHOS_LOCAL end
tmpDir, tmpBase = getTempPaths(test)
substitutions = list(extra_substitutions)
substitutions += getDefaultSubstitutions(test, tmpDir, tmpBase,
@@ -1742,5 +1746,18 @@ def executeShTest(test, litConfig, useExternalSh,
conditions = { feature: True for feature in test.config.available_features }
script = applySubstitutions(script, substitutions, conditions,
recursion_limit=test.config.recursiveExpansionLimit)
-
return _runShTest(test, litConfig, useExternalSh, script, tmpBase)
+
+def replaceEnvrunForScript(script):
+ """
+ Replace `env xxxx %libomp-run` in the script with `%libomp-env-run env xxxx %root-path%t`.
+ """
+ newScript = []
+ pattern = re.compile(r"(env\s+.*?)(\s+%libomp-run)")
+ replacement = r'%libomp-env-run \1 %root-path%t'
+ for ln in script:
+ if pattern.search(ln):
+ newScript.append(pattern.sub(replacement, ln))
+ else:
+ newScript.append(ln)
+ return newScript
\ No newline at end of file
diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py
index 55e2a764d8fa60055d98c3905d5f1cfa34fc55cb..e5d752f017aadd4ce6aa4d621e741c4ab735dff6 100644
--- a/llvm/utils/lit/lit/TestingConfig.py
+++ b/llvm/utils/lit/lit/TestingConfig.py
@@ -43,6 +43,10 @@ class TestingConfig(object):
'ADB',
'ANDROID_SERIAL',
'SSH_AUTH_SOCK',
+ 'HDC',
+ 'HDC_SERVER',
+ 'HDC_TARGET_SERIAL',
+ 'LIB_PATH_ON_TARGET',
'SANITIZER_IGNORE_CVE_2016_2143',
'TMPDIR',
'TMP',
diff --git a/openmp/runtime/src/kmp_config.h.cmake b/openmp/runtime/src/kmp_config.h.cmake
index 40d20115c9ec089d6b1c36e0284dd01d0db736a8..7e8dad4ca6c9f4ba4e28475955745acfd6429c41 100644
--- a/openmp/runtime/src/kmp_config.h.cmake
+++ b/openmp/runtime/src/kmp_config.h.cmake
@@ -134,9 +134,9 @@
# define KMP_GOMP_COMPAT
#endif
-// use shared memory with dynamic library (except Android, where shm_*
+// use shared memory with dynamic library (except Android and OHOS, where shm_*
// functions don't exist).
-#if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !__ANDROID__
+#if KMP_OS_UNIX && KMP_DYNAMIC_LIB && !__ANDROID__ && !__OHOS__
#define KMP_USE_SHM
#endif
#endif // KMP_CONFIG_H
diff --git a/openmp/runtime/test/affinity/format/nested.c b/openmp/runtime/test/affinity/format/nested.c
index db2e607bf8e65a6ed75677569784d4ae9ecd75aa..1d8bc8cb35c3d59bad6f55a99a2320b2e0b0c5fb 100644
--- a/openmp/runtime/test/affinity/format/nested.c
+++ b/openmp/runtime/test/affinity/format/nested.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES=threads OMP_PROC_BIND=spread,close %libomp-run | %python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES=threads OMP_PROC_BIND=spread,close %platform-flag %libomp-run | %python %S/check.py -c 'CHECK' %s
// REQUIRES: affinity
#include
diff --git a/openmp/runtime/test/affinity/format/nested2.c b/openmp/runtime/test/affinity/format/nested2.c
index f259aeace0d6d9edb5c098049c541b1476c5a7e8..059ea6a9c425e67a7f613c9b892ed7d9b2549e5d 100644
--- a/openmp/runtime/test/affinity/format/nested2.c
+++ b/openmp/runtime/test/affinity/format/nested2.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES=threads OMP_PROC_BIND=spread,close KMP_HOT_TEAMS_MAX_LEVEL=2 %libomp-run | %python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true OMP_PLACES=threads OMP_PROC_BIND=spread,close KMP_HOT_TEAMS_MAX_LEVEL=2 %platform-flag %libomp-run | %python %S/check.py -c 'CHECK' %s
#include
#include
diff --git a/openmp/runtime/test/affinity/format/nested_mixed.c b/openmp/runtime/test/affinity/format/nested_mixed.c
index 288e1c21c2bf9c743b0cead61acb3bae2d8cf0ed..dd1376a07b64b1bd5937de41d360d51781bfa4d6 100644
--- a/openmp/runtime/test/affinity/format/nested_mixed.c
+++ b/openmp/runtime/test/affinity/format/nested_mixed.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %libomp-run | %python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %platform-flag %libomp-run | %python %S/check.py -c 'CHECK' %s
#include
#include
diff --git a/openmp/runtime/test/affinity/format/nested_serial.c b/openmp/runtime/test/affinity/format/nested_serial.c
index 70ccf5be3c84e506d7065335d8ac90dc1a37c467..5e0ffc9cbbaf5a69fc5cccb9314bd074bd9ff042 100644
--- a/openmp/runtime/test/affinity/format/nested_serial.c
+++ b/openmp/runtime/test/affinity/format/nested_serial.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %libomp-run | %python %S/check.py -c 'CHECK' %s
+// RUN: %libomp-compile && env OMP_DISPLAY_AFFINITY=true %platform-flag %libomp-run | %python %S/check.py -c 'CHECK' %s
#include
#include
diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index 45e65d9c3ef6ba020de4aada01742cf3a108c9da..d4507c06d86500a4a217962ff79f3ebffc1acb35 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -51,6 +51,9 @@ if config.has_omit_frame_pointer_flag:
config.test_flags = " -I " + config.omp_header_directory + flags
config.test_flags_use_compiler_omp_h = flags
+# OHOS LOCAL
+if config.operating_system == 'OHOS':
+ config.test_flags += " --target=aarch64-linux-ohos"
# extra libraries
libs = ""
@@ -105,7 +108,7 @@ if 'Linux' in config.operating_system:
if config.operating_system == 'NetBSD':
config.available_features.add("netbsd")
-if config.operating_system in ['Linux', 'Windows']:
+if config.operating_system in ['Linux', 'Windows', 'OHOS']:
config.available_features.add('affinity')
import multiprocessing
@@ -134,7 +137,27 @@ config.substitutions.append(("%libomp-compile", \
"%clang %openmp_flags %flags %s -o %t" + libs))
config.substitutions.append(("%libomp-c99-compile", \
"%clang %openmp_flags %flags -std=c99 %s -o %t" + libs))
-config.substitutions.append(("%libomp-run", "%t"))
+
+# OHOS_LOCAL begin
+if config.operating_system == 'OHOS':
+ # Settings required to run test cases remotely on OHOS
+ if not (config.environment.get('HDC') != None and config.environment.get('HDC_SERVER') != None
+ and config.environment.get('HDC_TARGET_SERIAL') != None and config.environment.get('LIB_PATH_ON_TARGET') != None):
+ raise ValueError("Error: One or more environment variables in HDC, HDC_SERVER, HDC_TARGET_SERIAL or LIB_PATH_ON_TARGET are not set.")
+ hdc = f"{config.environment['HDC']} -s {config.environment['HDC_SERVER']} -t {config.environment['HDC_TARGET_SERIAL']}"
+ cmd_set_ld_library_path = f"env LD_LIBRARY_PATH={config.environment['LIB_PATH_ON_TARGET']}:$LD_LIBRARY_PATH"
+ cmd_mkdir_to_device = f"{hdc} shell mkdir -p /data/local/temp/$(dirname %t)"
+ cmd_push_to_device = f"{hdc} file send %t %root-path%t"
+ cmd_chmod_to_test = f"{hdc} shell chmod 755 %root-path%t"
+ cmd_run_on_device = f"{hdc} shell {cmd_set_ld_library_path} %root-path%t"
+ config.substitutions.append(("%libomp-env-run", f"{cmd_mkdir_to_device} && {cmd_push_to_device} && {cmd_chmod_to_test} && {hdc} shell {cmd_set_ld_library_path}"))
+ config.substitutions.append(("%libomp-run", f"{cmd_mkdir_to_device} && {cmd_push_to_device} && {cmd_chmod_to_test} && {cmd_run_on_device}"))
+ config.substitutions.append(("%root-path", "/data/local/temp"))
+ config.substitutions.append(("%platform-flag", "KMP_WARNINGS=false"))
+# OHOS_LOCAL end
+else:
+ config.substitutions.append(("%libomp-run", "%t"))
+ config.substitutions.append(("%platform-flag", ""))
config.substitutions.append(("%clangXX", config.test_cxx_compiler))
config.substitutions.append(("%clang", config.test_c_compiler))
config.substitutions.append(("%openmp_flags", config.test_openmp_flags))
diff --git a/openmp/tools/multiplex/tests/lit.cfg b/openmp/tools/multiplex/tests/lit.cfg
index 69df2fd944cb456d69aae10e3d1af3175ed28dd3..3e0666d360e6d79275abe997f102cffcd297c5f5 100644
--- a/openmp/tools/multiplex/tests/lit.cfg
+++ b/openmp/tools/multiplex/tests/lit.cfg
@@ -67,6 +67,10 @@ append_dynamic_library_path(config.test_obj_root+"/..")
if config.operating_system == 'Darwin':
config.test_flags += " -Wl,-rpath," + config.omp_library_dir
+# OHOS LOCAL
+if config.operating_system == 'OHOS':
+ config.test_flags += " --target=aarch64-linux-ohos"
+
# Find the SDK on Darwin
if config.operating_system == 'Darwin':
cmd = subprocess.Popen(['xcrun', '--show-sdk-path'],
@@ -90,7 +94,24 @@ config.substitutions.append(("%libomp-compile", \
"%clang %cflags %s -o %t"))
config.substitutions.append(("%libomp-tool", \
"%clang %cflags -shared -fPIC -g"))
-config.substitutions.append(("%libomp-run", "%t"))
+
+# OHOS_LOCAL begin
+if config.operating_system == 'OHOS':
+ if not (config.environment.get('HDC') != None and config.environment.get('HDC_SERVER') != None
+ and config.environment.get('HDC_TARGET_SERIAL') != None and config.environment.get('LIB_PATH_ON_TARGET') != None):
+ raise ValueError("Error: One or more environment variables in HDC, HDC_SERVER, HDC_TARGET_SERIAL or LIB_PATH_ON_TARGET are not set.")
+ hdc = f"{config.environment['HDC']} -s {config.environment['HDC_SERVER']} -t {config.environment['HDC_TARGET_SERIAL']}"
+ cmd_set_ld_library_path = f"env LD_LIBRARY_PATH={config.environment['LIB_PATH_ON_TARGET']}:$LD_LIBRARY_PATH"
+ cmd_mkdir_to_device = f"{hdc} shell mkdir -p /data/local/temp/$(dirname %t)"
+ cmd_push_to_device = f"{hdc} file send %t %root-path%t"
+ cmd_chmod_to_test = f"{hdc} shell chmod 755 %root-path%t"
+ cmd_run_on_device = f"{hdc} shell {cmd_set_ld_library_path} %root-path%t"
+ config.substitutions.append(("%libomp-env-run", f"{cmd_mkdir_to_device} && {cmd_push_to_device} && {cmd_chmod_to_test} && {hdc} shell {cmd_set_ld_library_path}"))
+ config.substitutions.append(("%libomp-run", f"{cmd_mkdir_to_device} && {cmd_push_to_device} && {cmd_chmod_to_test} && {cmd_run_on_device}"))
+ config.substitutions.append(("%root-path", "/data/local/temp"))
+# OHOS_LOCAL end
+else:
+ config.substitutions.append(("%libomp-run", "%t"))
config.substitutions.append(("%clang", config.test_c_compiler))
config.substitutions.append(("%openmp_flag", config.test_openmp_flags))
config.substitutions.append(("%cflags", config.test_flags))